Last active
May 8, 2021 07:55
-
-
Save gleox/1c7dfbfc5511bfbc737eddaa985c58dc to your computer and use it in GitHub Desktop.
一个站点部署两套vue程序
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name example.com; | |
listen 443 ssl; | |
ssl_certificate /opt/lego/certificates/example.com.crt; | |
ssl_certificate_key /opt/lego/certificates/example.com.key; | |
access_log /var/log/nginx/sites/example.com.log; | |
location / { | |
root /var/www/app1; | |
try_files $uri $uri/ /index.html; | |
} | |
location /app2 { | |
access_log off; | |
return 302 https://$host$request_uri/; | |
} | |
location /app2/ { | |
root /var/www/app2; | |
try_files $uri $uri/ /index.html; | |
} | |
location ~ ^/(api|avatar|file|swagger) { | |
proxy_http_version 1.1; | |
proxy_cache off; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-Host $http_host; | |
proxy_set_header X-Forwarded-For $http_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_pass http://backend; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment