73 lines
1.7 KiB
Nginx Configuration File
73 lines
1.7 KiB
Nginx Configuration File
upstream frontend {
|
|
server 172.17.0.1:3000;
|
|
}
|
|
|
|
upstream backend {
|
|
server 172.17.0.1:8080;
|
|
}
|
|
|
|
upstream minio {
|
|
server 172.17.0.1:9000;
|
|
}
|
|
|
|
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;
|
|
client_max_body_size 100M;
|
|
|
|
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/(.*)$ {
|
|
proxy_redirect off;
|
|
proxy_pass http://backend/$1$is_args$args;
|
|
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_set_header X-Forwarded-Host $server_name;
|
|
}
|
|
|
|
location /files {
|
|
rewrite ^/files/?(.*)$ /$1 break;
|
|
proxy_pass http://minio/files/$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;
|
|
}
|
|
}
|