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

質問編集履歴

2

依頼対応

2021/07/20 05:46

投稿

haroyan
haroyan

スコア13

title CHANGED
File without changes
body CHANGED
@@ -40,4 +40,94 @@
40
40
 
41
41
  サーバOS:CentOS Stream8 x86_64
42
42
  nginx:1.18.0
43
- php:7.2.24
43
+ php:7.2.24
44
+
45
+ ーーーーーーーーー
46
+ 追記
47
+ お待たせいたしました。
48
+ 以下(一部端折りましたが)大まかなnginx.confの内容になります。
49
+ ※★印の個所が今回の問題に上げている個所で、付近の記載は端折っていません。
50
+ ```
51
+ # For more information on configuration, see:
52
+ # * Official English Documentation: http://nginx.org/en/docs/
53
+ # * Official Russian Documentation: http://nginx.org/ru/docs/
54
+
55
+ user nginx;
56
+ worker_processes auto;
57
+ error_log /var/log/nginx/error.log;
58
+ pid /run/nginx.pid;
59
+
60
+ # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
61
+ include /usr/share/nginx/modules/*.conf;
62
+
63
+ events {
64
+ worker_connections 1024;
65
+ }
66
+
67
+ http {
68
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
69
+ '$status $body_bytes_sent "$http_referer" '
70
+ '"$http_user_agent" "$http_x_forwarded_for"';
71
+
72
+ access_log /var/log/nginx/access.log main;
73
+
74
+ sendfile on;
75
+ tcp_nopush on;
76
+ tcp_nodelay on;
77
+ keepalive_timeout 65;
78
+ types_hash_max_size 4096;
79
+
80
+ include /etc/nginx/mime.types;
81
+ default_type application/octet-stream;
82
+
83
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
84
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
85
+ # for more information.
86
+ include /etc/nginx/conf.d/*.conf;
87
+
88
+ server {
89
+ # httpをhttpsにリダイレクト
90
+ listen 80;
91
+ return 301 https://$host$request_uri;
92
+ }
93
+
94
+ server {
95
+ server_name www.mysite.jp;
96
+ root /usr/share/nginx/html;
97
+
98
+ # Load configuration files for the default server block.
99
+ include /etc/nginx/default.d/*.conf;
100
+
101
+ location / {
102
+ try_files $uri $uri/ /index.php?$args;
103
+ }
104
+     //★★★★★★
105
+ location /test/ {
106
+ if ($http_user_agent ~* “(iPhone|iPod|Android.*Mobile)“){
107
+ return 301 https://www.mysite.jp/test/s/index.php;
108
+ }
109
+ }
110
+ #/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
111
+ location ~ .php$ {
112
+ root /usr/share/nginx/html;
113
+ fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
114
+ fastcgi_index index.php;
115
+ fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
116
+ include fastcgi_params;
117
+ }
118
+
119
+ #/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
120
+
121
+ error_page 404 /404.html;
122
+ location = /40x.html {
123
+ }
124
+
125
+ error_page 500 502 503 504 /50x.html;
126
+ location = /50x.html {
127
+ }
128
+
129
+
130
+
131
+
132
+ }
133
+ ```

1

宜しくお願いします。の文言追記(teratailのバグで途中から文字が表示されなくなったため)

2021/07/20 05:46

投稿

haroyan
haroyan

スコア13

title CHANGED
File without changes
body CHANGED
@@ -14,6 +14,7 @@
14
14
  ちゃんとスマホ用サイトに切り替えることが出来ていたので猶更謎です・・・
15
15
 
16
16
  お心当たりのある方、アドバイス頂けると幸いです。
17
+ よろしくお願いいたします。
17
18
 
18
19
  ### 試したこと
19
20