質問編集履歴
3
nginx.confの更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
error_log /var/log/nginx/error.log
|
85
|
+
error_log /var/log/nginx/error.log debug;
|
86
86
|
|
87
87
|
pid /var/run/nginx.pid;
|
88
88
|
|
@@ -136,8 +136,6 @@
|
|
136
136
|
|
137
137
|
root /var/www/html;
|
138
138
|
|
139
|
-
return 301 https://〇〇.com$request_uri;
|
140
|
-
|
141
139
|
}
|
142
140
|
|
143
141
|
|
@@ -162,36 +160,6 @@
|
|
162
160
|
|
163
161
|
}
|
164
162
|
|
165
|
-
|
166
|
-
|
167
|
-
location / {
|
168
|
-
|
169
|
-
try_files $uri $uri/ /index.php?$query_string;
|
170
|
-
|
171
|
-
root /var/www/html;
|
172
|
-
|
173
|
-
index index.html index.html index.php;
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
if ( -f $request_filename ) {
|
178
|
-
|
179
|
-
expires 30d;
|
180
|
-
|
181
|
-
break;
|
182
|
-
|
183
|
-
}
|
184
|
-
|
185
|
-
if (!-e $request_filename) {
|
186
|
-
|
187
|
-
rewrite ^.+?(/.*.php)$ $1 last;
|
188
|
-
|
189
|
-
rewrite ^ /index.php last;
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
163
|
}
|
196
164
|
|
197
165
|
```
|
2
nginx.confの更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -134,6 +134,8 @@
|
|
134
134
|
|
135
135
|
server_name 〇〇.com;
|
136
136
|
|
137
|
+
root /var/www/html;
|
138
|
+
|
137
139
|
return 301 https://〇〇.com$request_uri;
|
138
140
|
|
139
141
|
}
|
1
nginx.confを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,4 +72,128 @@
|
|
72
72
|
|
73
73
|
|
74
74
|
|
75
|
+
nginx.comf
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
user nginx;
|
80
|
+
|
81
|
+
worker_processes 1;
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
error_log /var/log/nginx/error.log warn;
|
86
|
+
|
87
|
+
pid /var/run/nginx.pid;
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
events {
|
94
|
+
|
95
|
+
worker_connections 1024;
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
http {
|
102
|
+
|
103
|
+
include /etc/nginx/mime.types;
|
104
|
+
|
105
|
+
default_type application/octet-stream;
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
110
|
+
|
111
|
+
'$status $body_bytes_sent "$http_referer" '
|
112
|
+
|
113
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
access_log /var/log/nginx/access.log main;
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
sendfile on;
|
122
|
+
|
123
|
+
#tcp_nopush on;
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
keepalive_timeout 65;
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
server {
|
132
|
+
|
133
|
+
listen 80;
|
134
|
+
|
135
|
+
server_name 〇〇.com;
|
136
|
+
|
137
|
+
return 301 https://〇〇.com$request_uri;
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
server {
|
144
|
+
|
145
|
+
listen 443 ssl;
|
146
|
+
|
147
|
+
server_name 〇〇.com;
|
148
|
+
|
149
|
+
charset UTF-8;
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# LetsEncrypt
|
154
|
+
|
155
|
+
location ^~ /.well-known/acme-challenge/ {
|
156
|
+
|
157
|
+
allow all;
|
158
|
+
|
159
|
+
root /var/www/html;
|
160
|
+
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
location / {
|
166
|
+
|
167
|
+
try_files $uri $uri/ /index.php?$query_string;
|
168
|
+
|
169
|
+
root /var/www/html;
|
170
|
+
|
171
|
+
index index.html index.html index.php;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
if ( -f $request_filename ) {
|
176
|
+
|
177
|
+
expires 30d;
|
178
|
+
|
179
|
+
break;
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
if (!-e $request_filename) {
|
184
|
+
|
185
|
+
rewrite ^.+?(/.*.php)$ $1 last;
|
186
|
+
|
187
|
+
rewrite ^ /index.php last;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
}
|
194
|
+
|
195
|
+
```
|
196
|
+
|
197
|
+
|
198
|
+
|
75
199
|
ちなみに、nginxを起動した状態と停止させた状態でも実行しましたがエラーでした。
|