本文共 3259 字,大约阅读时间需要 10 分钟。
????????????????????????????????
![??????????????]
??????????????Nginx?location??
server { listen 80; server_name xxx.com; location / { proxy_pass http://127.0.0.1:8000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; client_body_buffer_size 128k; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; add_header X-Frame-Options SAMEORIGIN; } location /goa { proxy_pass http://127.0.0.1:8090/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; client_body_buffer_size 128k; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; add_header X-Frame-Options SAMEORIGIN; }} ?????????xxx.com/goa??????CSS?JS???????????????????????/goa?????????????????Nginx????????location?????????
server { listen 80; server_name xxx.com; location / { proxy_pass http://127.0.0.1:8000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; client_body_buffer_size 128k; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; add_header X-Frame-Options SAMEORIGIN; } location /goa { proxy_pass http://127.0.0.1:8090/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; client_body_buffer_size 128k; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; add_header X-Frame-Options SAMEORIGIN; } location ~ ^(/css/|/Scripts/|/site/|/images/) { if ($host = "xxx.com") { rewrite ^/css/(.*) /goa/css/$1 last; rewrite ^/site/(.*) /goa/site/$1 last; rewrite ^/Scripts/(.*) /goa/Scripts/$1 last; rewrite ^/images/(.*) /goa/images/$1 last; } }} location ~ ^(/css/|/Scripts/|/site/|/images/)??????/css/?/Scripts/?/site/?/images/??????rewrite????????????????????/goa??????last????????????????????????????????????????????????Nginx?
nginx -t
??????Nginx?????????
/goa/css/?/goa/Scripts/????????????????????????????????????????????
转载地址:http://pzjfk.baihongyu.com/