質問するログイン新規登録

質問編集履歴

4

コメントアウトの表記

2017/11/27 07:31

投稿

takahirono4
takahirono4

スコア7

title CHANGED
File without changes
body CHANGED
@@ -70,16 +70,21 @@
70
70
 
71
71
  ●/etc/nginx/nginx.conf
72
72
 
73
+ ///////////////////コメントアウト//////////////////
73
- # For more information on configuration, see:
74
+ For more information on configuration, see:
74
- # * Official English Documentation: http://nginx.org/en/docs/
75
+ * Official English Documentation: http://nginx.org/en/docs/
75
- # * Official Russian Documentation: http://nginx.org/ru/docs/
76
+ * Official Russian Documentation: http://nginx.org/ru/docs/
77
+ ///////////////////コメントアウト//////////////////
76
78
 
77
79
  user nginx;
78
80
  worker_processes auto;
79
81
  error_log /var/log/nginx/error.log;
80
82
  pid /var/run/nginx.pid;
81
83
 
84
+ ///////////////////コメントアウト//////////////////
82
- # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
85
+ Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
86
+ ///////////////////コメントアウト//////////////////
87
+
83
88
  include /usr/share/nginx/modules/*.conf;
84
89
 
85
90
  events {
@@ -101,10 +106,13 @@
101
106
 
102
107
  include /etc/nginx/mime.types;
103
108
  default_type application/octet-stream;
109
+
110
+ ///////////////////コメントアウト//////////////////
111
+ Load modular configuration files from the /etc/nginx/conf.d directory.
112
+ See http://nginx.org/en/docs/ngx_core_module.html include
113
+ for more information.
114
+ ///////////////////コメントアウト//////////////////
104
115
 
105
- # Load modular configuration files from the /etc/nginx/conf.d directory.
106
- # See http://nginx.org/en/docs/ngx_core_module.html#include
107
- # for more information.
108
116
  include /etc/nginx/conf.d/*.conf;
109
117
 
110
118
  index index.html index.htm;
@@ -114,82 +122,85 @@
114
122
  listen [::]:80 default_server;
115
123
  server_name localhost;
116
124
  root /usr/share/nginx/html;
125
+
126
+ ///////////////////コメントアウト//////////////////
127
+ Load configuration files for the default server block.
128
+ ///////////////////コメントアウト//////////////////
117
129
 
118
- # Load configuration files for the default server block.
119
130
  include /etc/nginx/default.d/*.conf;
120
131
 
121
132
  location / {
122
133
  }
134
+ ///////////////////コメントアウト//////////////////
135
+ redirect server error pages to the static page /40x.html
136
+ ///////////////////コメントアウト//////////////////
123
137
 
124
- # redirect server error pages to the static page /40x.html
125
- #
126
138
  error_page 404 /404.html;
127
139
  location = /40x.html {
128
140
  }
129
141
 
142
+ ///////////////////コメントアウト//////////////////
130
- # redirect server error pages to the static page /50x.html
143
+ redirect server error pages to the static page /50x.html
131
- #
144
+ ///////////////////コメントアウト//////////////////
145
+
132
146
  error_page 500 502 503 504 /50x.html;
133
147
  location = /50x.html {
134
148
  }
135
149
 
150
+ ///////////////////コメントアウト//////////////////
136
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
151
+ proxy the PHP scripts to Apache listening on 127.0.0.1:80
137
- #
138
- #location ~ .php$ {
152
+ location ~ .php$ {
139
- # proxy_pass http://127.0.0.1;
153
+ proxy_pass http://127.0.0.1;
140
- #}
154
+ }
141
155
 
142
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
156
+ pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
143
- #
144
- #location ~ .php$ {
157
+ location ~ .php$ {
145
- # root html;
158
+ root html;
146
- # fastcgi_pass 127.0.0.1:9000;
159
+ fastcgi_pass 127.0.0.1:9000;
147
- # fastcgi_index index.php;
160
+ fastcgi_index index.php;
148
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
161
+ fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
149
- # include fastcgi_params;
162
+ include fastcgi_params;
150
- #}
163
+ }
151
164
 
152
- # deny access to .htaccess files, if Apache's document root
165
+ deny access to .htaccess files, if Apache's document root
153
- # concurs with nginx's one
166
+ concurs with nginx's one
154
- #
155
- #location ~ /.ht {
167
+ location ~ /.ht {
156
- # deny all;
168
+ deny all;
157
- #}
158
- }
169
+ }
159
- # Settings for a TLS enabled server.
160
- #
161
- # server {
162
- # listen 443 ssl http2 default_server;
163
- # listen [::]:443 ssl http2 default_server;
164
- # server_name _;
165
- # root /usr/share/nginx/html;
166
- #
167
- # ssl_certificate "/etc/pki/nginx/server.crt";
168
- # ssl_certificate_key "/etc/pki/nginx/private/server.key";
170
+ ///////////////////コメントアウト//////////////////
169
- # # It is *strongly* recommended to generate unique DH parameters
170
- # # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
171
- # #ssl_dhparam "/etc/pki/nginx/dhparams.pem";
172
- # ssl_session_cache shared:SSL:1m;
173
- # ssl_session_timeout 10m;
174
- # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
175
- # ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
176
- # ssl_prefer_server_ciphers on;
177
- #
178
- # # Load configuration files for the default server block.
179
- # include /etc/nginx/default.d/*.conf;
180
- #
181
- # location / {
182
- # }
183
- #
184
- # error_page 404 /404.html;
185
- # location = /40x.html {
186
- # }
187
- #
188
- # error_page 500 502 503 504 /50x.html;
189
- # location = /50x.html {
190
- # }
191
- # }
192
171
 
172
+ }
173
+
174
+ ///////////////////コメントアウト//////////////////
175
+ Settings for a TLS enabled server.
176
+ server {
177
+ listen 443 ssl http2 default_server;
178
+ listen [::]:443 ssl http2 default_server;
179
+ server_name _;
180
+ root /usr/share/nginx/html;
181
+ ssl_certificate "/etc/pki/nginx/server.crt";
182
+ ssl_certificate_key "/etc/pki/nginx/private/server.key";
183
+ It is *strongly* recommended to generate unique DH parameters
184
+ Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
185
+ ssl_dhparam "/etc/pki/nginx/dhparams.pem";
186
+ ssl_session_cache shared:SSL:1m;
187
+ ssl_session_timeout 10m;
188
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
189
+ ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
190
+ ssl_prefer_server_ciphers on;
191
+ Load configuration files for the default server block.
192
+ include /etc/nginx/default.d/*.conf;
193
+ location / {
194
+ }
195
+ error_page 404 /404.html;
196
+ location = /40x.html {
197
+ }
198
+ error_page 500 502 503 504 /50x.html;
199
+ location = /50x.html {
200
+ }
201
+ }
202
+ ///////////////////コメントアウト//////////////////
203
+
193
204
  }
194
205
 
195
206
  nginxはアンインストール後にインストールし直しましたが、conf.d/nginx.confはアンインストール前の記述が残っておりました。

3

コメントアウト入力

2017/11/27 07:31

投稿

takahirono4
takahirono4

スコア7

title CHANGED
File without changes
body CHANGED
File without changes

2

書き替え

2017/11/27 07:08

投稿

takahirono4
takahirono4

スコア7

title CHANGED
File without changes
body CHANGED
@@ -8,6 +8,8 @@
8
8
  ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
9
9
 
10
10
 
11
+ 追記です。
12
+
11
13
  大変申し訳ありません。
12
14
  改行したものを追記いたします。
13
15
 

1

追記

2017/11/27 07:07

投稿

takahirono4
takahirono4

スコア7

title CHANGED
File without changes
body CHANGED
@@ -5,4 +5,194 @@
5
5
  特に問題が内容でしたら、このまま運用しようと思うのですが。
6
6
 
7
7
  ちなみにproduction.logのエラーコードはこのような感じです。
8
- ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
8
+ ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
9
+
10
+
11
+ 大変申し訳ありません。
12
+ 改行したものを追記いたします。
13
+
14
+ 以下同じ内容です。
15
+
16
+ ご覧いただきまして、ありがとうございます。
17
+
18
+ 説明不足で申し訳ございません。
19
+ セキュリティグループや各種設定は問題ないと存じます。
20
+ 現状はポート80の時にCSSとjsが反映されない状況です。
21
+ 3000番ポートの時はcssやjsも正常に表示されます。
22
+
23
+ 先日までポート80でもきちんとCSSが反映されておりましたが、unicornの設定の不具合で色々と作業を行ううちに、反映されなくなってしまいました。
24
+ おそらくnginxが導入されていない状態なのかと思うのですが、実際はインストールされております。
25
+
26
+ nginxを認識させるために試したこと:
27
+ sudo service nginx stop
28
+ sudo service nginx start
29
+ sudo yum remove nginx
30
+ sudo yum install nginx
31
+
32
+
33
+ 現状のnginxの設定ファイルは以下の通りです。
34
+
35
+ ●/etc/nginx/conf.d/app.conf
36
+
37
+ upstream app_server{
38
+ server 127.0.0.1:3000;
39
+ }
40
+
41
+ server {
42
+ listen 80;
43
+ server_name xxx.xxx.xxx.xxx;
44
+
45
+
46
+ root /var/www/my_app/public;
47
+
48
+ location ^~ /assets/ {
49
+ gzip_static on;
50
+ expires max;
51
+ add_header Cache-Control public;
52
+ }
53
+
54
+ try_files $uri/index.html $uri @unicorn;
55
+
56
+ location @unicorn {
57
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58
+ proxy_set_header Host $http_host;
59
+ proxy_redirect off;
60
+ proxy_pass http://app_server;
61
+
62
+ }
63
+
64
+ error_page 500 502 503 504 /500.html;
65
+
66
+ }
67
+
68
+
69
+ ●/etc/nginx/nginx.conf
70
+
71
+ # For more information on configuration, see:
72
+ # * Official English Documentation: http://nginx.org/en/docs/
73
+ # * Official Russian Documentation: http://nginx.org/ru/docs/
74
+
75
+ user nginx;
76
+ worker_processes auto;
77
+ error_log /var/log/nginx/error.log;
78
+ pid /var/run/nginx.pid;
79
+
80
+ # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
81
+ include /usr/share/nginx/modules/*.conf;
82
+
83
+ events {
84
+ worker_connections 1024;
85
+ }
86
+
87
+ http {
88
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
89
+ '$status $body_bytes_sent "$http_referer" '
90
+ '"$http_user_agent" "$http_x_forwarded_for"';
91
+
92
+ access_log /var/log/nginx/access.log main;
93
+
94
+ sendfile on;
95
+ tcp_nopush on;
96
+ tcp_nodelay on;
97
+ keepalive_timeout 65;
98
+ types_hash_max_size 2048;
99
+
100
+ include /etc/nginx/mime.types;
101
+ default_type application/octet-stream;
102
+
103
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
104
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
105
+ # for more information.
106
+ include /etc/nginx/conf.d/*.conf;
107
+
108
+ index index.html index.htm;
109
+
110
+ server {
111
+ listen 80 default_server;
112
+ listen [::]:80 default_server;
113
+ server_name localhost;
114
+ root /usr/share/nginx/html;
115
+
116
+ # Load configuration files for the default server block.
117
+ include /etc/nginx/default.d/*.conf;
118
+
119
+ location / {
120
+ }
121
+
122
+ # redirect server error pages to the static page /40x.html
123
+ #
124
+ error_page 404 /404.html;
125
+ location = /40x.html {
126
+ }
127
+
128
+ # redirect server error pages to the static page /50x.html
129
+ #
130
+ error_page 500 502 503 504 /50x.html;
131
+ location = /50x.html {
132
+ }
133
+
134
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
135
+ #
136
+ #location ~ .php$ {
137
+ # proxy_pass http://127.0.0.1;
138
+ #}
139
+
140
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
141
+ #
142
+ #location ~ .php$ {
143
+ # root html;
144
+ # fastcgi_pass 127.0.0.1:9000;
145
+ # fastcgi_index index.php;
146
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
147
+ # include fastcgi_params;
148
+ #}
149
+
150
+ # deny access to .htaccess files, if Apache's document root
151
+ # concurs with nginx's one
152
+ #
153
+ #location ~ /.ht {
154
+ # deny all;
155
+ #}
156
+ }
157
+ # Settings for a TLS enabled server.
158
+ #
159
+ # server {
160
+ # listen 443 ssl http2 default_server;
161
+ # listen [::]:443 ssl http2 default_server;
162
+ # server_name _;
163
+ # root /usr/share/nginx/html;
164
+ #
165
+ # ssl_certificate "/etc/pki/nginx/server.crt";
166
+ # ssl_certificate_key "/etc/pki/nginx/private/server.key";
167
+ # # It is *strongly* recommended to generate unique DH parameters
168
+ # # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
169
+ # #ssl_dhparam "/etc/pki/nginx/dhparams.pem";
170
+ # ssl_session_cache shared:SSL:1m;
171
+ # ssl_session_timeout 10m;
172
+ # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
173
+ # ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
174
+ # ssl_prefer_server_ciphers on;
175
+ #
176
+ # # Load configuration files for the default server block.
177
+ # include /etc/nginx/default.d/*.conf;
178
+ #
179
+ # location / {
180
+ # }
181
+ #
182
+ # error_page 404 /404.html;
183
+ # location = /40x.html {
184
+ # }
185
+ #
186
+ # error_page 500 502 503 504 /50x.html;
187
+ # location = /50x.html {
188
+ # }
189
+ # }
190
+
191
+ }
192
+
193
+ nginxはアンインストール後にインストールし直しましたが、conf.d/nginx.confはアンインストール前の記述が残っておりました。
194
+ アンインストールする場合は、confファイルも別にrmで削除したほうが良いのでしょうか。
195
+ nginxのファイルがどのディレクトリにどのように入っているのかわからず、上記のようにいたしました。
196
+ 何かお気付きになる点などがございましたら、ぜひご教授くださいませ。
197
+
198
+ よろしくお願いいたします。