59 lines
1.3 KiB
Nginx Configuration File
59 lines
1.3 KiB
Nginx Configuration File
upstream frontend {
|
|
server 172.17.0.1:3000;
|
|
}
|
|
|
|
upstream backend {
|
|
server 172.17.0.1:8080;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name portal.bytser.com;
|
|
|
|
location ~ /.well-known/acme-challenge {
|
|
allow all;
|
|
root /tmp/acme_challenge;
|
|
}
|
|
|
|
location / {
|
|
rewrite ^ https://$host$request_uri? permanent;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl http2;
|
|
server_name portal.bytser.com;
|
|
ssl_certificate /etc/letsencrypt/live/portal.bytser.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/portal.bytser.com/privkey.pem;
|
|
|
|
location / {
|
|
rewrite ^/?(.*)$ /$1 break;
|
|
proxy_pass http://frontend/$1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /api {
|
|
rewrite ^/api/?(.*)$ /$1 break;
|
|
proxy_pass http://backend/$1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|