質問編集履歴
2
依頼対応
test
CHANGED
File without changes
|
test
CHANGED
@@ -83,3 +83,183 @@
|
|
83
83
|
nginx:1.18.0
|
84
84
|
|
85
85
|
php:7.2.24
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
ーーーーーーーーー
|
90
|
+
|
91
|
+
追記
|
92
|
+
|
93
|
+
お待たせいたしました。
|
94
|
+
|
95
|
+
以下(一部端折りましたが)大まかなnginx.confの内容になります。
|
96
|
+
|
97
|
+
※★印の個所が今回の問題に上げている個所で、付近の記載は端折っていません。
|
98
|
+
|
99
|
+
```
|
100
|
+
|
101
|
+
# For more information on configuration, see:
|
102
|
+
|
103
|
+
# * Official English Documentation: http://nginx.org/en/docs/
|
104
|
+
|
105
|
+
# * Official Russian Documentation: http://nginx.org/ru/docs/
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
user nginx;
|
110
|
+
|
111
|
+
worker_processes auto;
|
112
|
+
|
113
|
+
error_log /var/log/nginx/error.log;
|
114
|
+
|
115
|
+
pid /run/nginx.pid;
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
|
120
|
+
|
121
|
+
include /usr/share/nginx/modules/*.conf;
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
events {
|
126
|
+
|
127
|
+
worker_connections 1024;
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
http {
|
134
|
+
|
135
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
136
|
+
|
137
|
+
'$status $body_bytes_sent "$http_referer" '
|
138
|
+
|
139
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
access_log /var/log/nginx/access.log main;
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
sendfile on;
|
148
|
+
|
149
|
+
tcp_nopush on;
|
150
|
+
|
151
|
+
tcp_nodelay on;
|
152
|
+
|
153
|
+
keepalive_timeout 65;
|
154
|
+
|
155
|
+
types_hash_max_size 4096;
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
include /etc/nginx/mime.types;
|
160
|
+
|
161
|
+
default_type application/octet-stream;
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
# Load modular configuration files from the /etc/nginx/conf.d directory.
|
166
|
+
|
167
|
+
# See http://nginx.org/en/docs/ngx_core_module.html#include
|
168
|
+
|
169
|
+
# for more information.
|
170
|
+
|
171
|
+
include /etc/nginx/conf.d/*.conf;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
server {
|
176
|
+
|
177
|
+
# httpをhttpsにリダイレクト
|
178
|
+
|
179
|
+
listen 80;
|
180
|
+
|
181
|
+
return 301 https://$host$request_uri;
|
182
|
+
|
183
|
+
}
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
server {
|
188
|
+
|
189
|
+
server_name www.mysite.jp;
|
190
|
+
|
191
|
+
root /usr/share/nginx/html;
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
# Load configuration files for the default server block.
|
196
|
+
|
197
|
+
include /etc/nginx/default.d/*.conf;
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
location / {
|
202
|
+
|
203
|
+
try_files $uri $uri/ /index.php?$args;
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
//★★★★★★
|
208
|
+
|
209
|
+
location /test/ {
|
210
|
+
|
211
|
+
if ($http_user_agent ~* “(iPhone|iPod|Android.*Mobile)“){
|
212
|
+
|
213
|
+
return 301 https://www.mysite.jp/test/s/index.php;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
#/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
220
|
+
|
221
|
+
location ~ .php$ {
|
222
|
+
|
223
|
+
root /usr/share/nginx/html;
|
224
|
+
|
225
|
+
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
|
226
|
+
|
227
|
+
fastcgi_index index.php;
|
228
|
+
|
229
|
+
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
|
230
|
+
|
231
|
+
include fastcgi_params;
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
#/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
error_page 404 /404.html;
|
242
|
+
|
243
|
+
location = /40x.html {
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
error_page 500 502 503 504 /50x.html;
|
250
|
+
|
251
|
+
location = /50x.html {
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
```
|
1
宜しくお願いします。の文言追記(teratailのバグで途中から文字が表示されなくなったため)
test
CHANGED
File without changes
|
test
CHANGED
@@ -29,6 +29,8 @@
|
|
29
29
|
|
30
30
|
|
31
31
|
お心当たりのある方、アドバイス頂けると幸いです。
|
32
|
+
|
33
|
+
よろしくお願いいたします。
|
32
34
|
|
33
35
|
|
34
36
|
|