You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6 KiB

map $http_upgrade $connection_upgrade{
default upgrade;
'' close;
}
server {
listen 50001;
client_max_body_size 20m;
proxy_max_temp_file_size 0;
location ^~ / {
proxy_pass http://frontend:50002;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location ^~/api/ {
proxy_pass http://backend:50000;
proxy_set_header nginx true;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
# location ^~/static/ {
# root /home/ubuntu/blog;
# }
# location = /ads.txt {
# root /home/ubuntu/blog;
# }
rewrite /sitemap.txt /api/sitemap.txt;
rewrite /sitemap.xml /api/sitemap.xml;
rewrite /rss.xml /api/rss.xml;
rewrite /robots.txt /api/robots.txt;
}