# 技术圈 server { listen 80; server_name {{domain}}.test-jishuin.proginn.com; root /code/web/phphub/public; index index.php; rewrite ^/u/(\d+)$ /jishuin/u/$1 last; rewrite ^/user/(\d+)$ /u/$1 permanent; rewrite ^/user/collect_article/(\d+)$ /jishuin/c/$1 permanent; rewrite ^/c/([a-z0-9]+)$ /jishuin/c/$1 last; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } set $temp_request_id $http_x_request_id; if ($temp_request_id = "") { set $temp_request_id $request_id; } location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) { deny all; } location ^~ /c/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /u/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /jishuin/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /user/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /user/quit { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /topics/create { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ~ /topics/\d+/edit { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /file/proxyUpload { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location /ajax/getmessage { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location /api { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /.nuxt { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /_nuxt { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ~ \.php$ { fastcgi_pass unix:/var/run/php7-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } access_log /data/log/jishuin.log proginn-logid; } # 解决方案 server { listen 80; server_name {{domain}}.test-kaifain.proginn.com; root /code/web/; index index.php; rewrite ^/s/([a-z0-9]+)$ /kaifain/s/$1 last; rewrite ^/d/([a-z0-9]+)$ /kaifain/case/$1 last; rewrite ^/c/([a-z0-9]+)$ /kaifain/$1 last; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } set $temp_request_id $http_x_request_id; if ($temp_request_id = "") { set $temp_request_id $request_id; } location ~ ^/(composer.json|composer.lock|ThinkPHP/|vendor/|src/|bin/|App/|.git) { deny all; } location ^~ /kaifain { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-kaifain.proginn.com; } location ^~ /user/quit { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /file/proxyUpload { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location /ajax/getmessage { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location /api { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /.nuxt { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-kaifain.proginn.com; } location ^~ /_nuxt { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test-kaifain.proginn.com; } location ~ \.php$ { fastcgi_pass unix:/var/run/php7-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } access_log /data/log/kafain.log proginn-logid; } # proginn server { listen 80; server_name {{domain}}.test.proginn.com; root /code/web/; index index.php index.html index.htm; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } set $temp_request_id $http_x_request_id; if ($temp_request_id = "") { set $temp_request_id $request_id; } location /community { rewrite ^/community(.*)$ https://{{domain}}.test-jishuin.proginn.com$1 permanent; } location /festival { alias /festival/dist; index index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /festival/index.html last; break; } } location /oauth2 { alias /code/web/openx/public/oauth2; index index.php; if (!-e $request_filename) { rewrite ^(.*)$ /oauth2/index.php last; break; } location ~ \.php$ { fastcgi_pass unix:/var/run/php7-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } } location /openapi { alias /code/web/openx/public/api; index index.php; if (!-e $request_filename) { rewrite ^(.*)$ /openapi/index.php last; break; } location ~ \.php$ { fastcgi_pass unix:/var/run/php7-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } } location ~ \.php$ { fastcgi_pass unix:/var/run/php7-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ^~ /type/vip { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /cert { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /group { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /setting/check/old_mobile { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /setting/check/real_info { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /setting/check/change_mobile { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /user/register { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /.nuxt { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /_nuxt { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /wo/cash { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /sign/new { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /type/interview { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /type/partners/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /wo/bills { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /job/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /recruit/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /salary/ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /salary/detail { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /credit { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /otherpage { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /kaifain { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /user/collection { proxy_pass http://127.0.0.1:3000; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /upload_image { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test-jishuin.proginn.com; } location ^~ /Public/ { # 匹配任何以 /Public/ 开头的地址,匹配符合以后,停止往下搜索正则,采用这一条。 expires 1d; access_log off; } access_log /data/log/access.log proginn-logid; } # 新后台 server { listen 80; server_name {{domain}}.test-rooter.proginn.com; root /boss/dist; index index.html index.htm; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.html last; break; } } set $temp_request_id $http_x_request_id; if ($temp_request_id = "") { set $temp_request_id $request_id; } location /api { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /upload_image { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } access_log /data/log/boss.log proginn-logid; } # festival server { listen 80; server_name {{domain}}.test-festival.proginn.com; root /boss/dist; index index.html index.htm; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.html last; break; } } location /api { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } location ^~ /upload_image { proxy_pass http://127.0.0.1; proxy_set_header Host {{domain}}.test.proginn.com; } access_log /data/log/festival.log proginn-logid; }