app配置server { listen 80; server_name m.in83.com; access_log /var/www/nginx/m.in83.com.log; index index.htm index.html; root /var/www/in83/m/; location =/ { index index.htm index.html; root /var/www/in83/m/; } location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; set $mobile_request '0'; if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry)') { set $mobile_request '1'; } if ($mobile_request != '1') { rewrite ^.+ http://www.in83.com$uri; } if (!-f $request_filename) { proxy_pass http://115.159.142.246:2020; break; } } }pc配置server { listen 80; server_name in83.com www.in83.com; access_log /var/www/nginx/www.in83.com.log; index index.htm index.html; root /var/www/in83/www/; location =/ { index index.htm index.html; root /var/www/in83/www/; } location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry)') { set $mobile_request '1'; } if ($mobile_request = '1') { rewrite ^.+ http://m.in83.com$uri; } if (!-f $request_filename) { proxy_pass http://115.159.142.246:2020; break; } } }参考的https://www.jianshu.com/p/f955fbd4760b
app配置
pc配置
参考的https://www.jianshu.com/p/f955fbd4760b