oneuptime/Nginx/default.conf.template

377 lines
14 KiB
Plaintext
Raw Normal View History

2022-12-07 08:38:02 +00:00
upstream accounts {
server accounts:3003 weight=10 max_fails=3 fail_timeout=30s;
}
upstream identity {
server identity:3087 weight=10 max_fails=3 fail_timeout=30s;
}
upstream file {
server file:3125 weight=10 max_fails=3 fail_timeout=30s;
}
upstream dashboard-api {
server dashboard-api:3002 weight=10 max_fails=3 fail_timeout=30s;
}
2023-02-01 13:08:45 +00:00
upstream workflow {
server workflow:3099 weight=10 max_fails=3 fail_timeout=30s;
}
2023-07-01 12:08:50 +00:00
2023-07-29 23:03:00 +00:00
upstream link-shortener {
server link-shortener:3521 weight=10 max_fails=3 fail_timeout=30s;
2023-07-01 12:08:50 +00:00
}
2023-04-05 10:10:18 +00:00
upstream api-reference {
server api-reference:1445 weight=10 max_fails=3 fail_timeout=30s;
2023-02-07 21:51:53 +00:00
}
2023-05-02 14:29:22 +00:00
upstream probe-api {
2023-06-01 18:58:43 +00:00
server probe-api:3400 weight=10 max_fails=3 fail_timeout=30s;
2023-05-02 14:29:22 +00:00
}
2022-12-07 08:38:02 +00:00
upstream dashboard {
server dashboard:3009 weight=10 max_fails=3 fail_timeout=30s;
}
upstream status-page {
server status-page:3105 weight=10 max_fails=3 fail_timeout=30s;
}
upstream home {
server home:1444 weight=10 max_fails=3 fail_timeout=30s;
}
upstream workers {
server workers:3452 weight=10 max_fails=3 fail_timeout=30s;
}
2023-06-06 20:23:56 +00:00
upstream notification {
2023-06-06 20:32:18 +00:00
server notification:3191 weight=10 max_fails=3 fail_timeout=30s;
2022-12-30 15:05:25 +00:00
}
2023-01-02 10:15:11 +00:00
2022-12-09 08:19:51 +00:00
server {
listen 80 default_server;
2023-01-02 10:15:11 +00:00
server_name _; # All domains.
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
location / {
return 301 https://$host$request_uri;
}
location /status-page {
return 301 https://$host$request_uri;
}
location /status-page-api {
2023-01-03 13:20:10 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2023-01-02 10:15:11 +00:00
proxy_pass http://dashboard-api/api/status-page/status-page-api;
}
# Acme Verification.
location /.well-known {
2023-01-03 13:20:10 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2023-01-02 10:15:11 +00:00
proxy_pass http://dashboard-api/api/status-page/.well-known;
}
}
server {
2022-12-11 08:02:56 +00:00
listen 443 default_server ssl; # Port HTTPS
2022-12-09 08:19:51 +00:00
2022-12-11 08:02:56 +00:00
ssl_certificate /etc/nginx/certs/StatusPageCerts/$ssl_server_name.crt;
ssl_certificate_key /etc/nginx/certs/StatusPageCerts/$ssl_server_name.key;
2022-12-07 08:38:02 +00:00
server_name _; # All domains.
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
2022-12-10 14:30:39 +00:00
location / {
2022-12-09 12:13:12 +00:00
2022-12-07 08:38:02 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-10 14:30:39 +00:00
2022-12-11 08:02:56 +00:00
proxy_pass http://status-page;
2022-12-10 14:30:39 +00:00
2022-12-07 08:38:02 +00:00
}
location /status-page {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-10 14:30:39 +00:00
2022-12-11 08:02:56 +00:00
proxy_pass http://status-page;
2022-12-07 08:38:02 +00:00
}
}
server {
2022-12-14 15:14:41 +00:00
listen 80;
2023-07-19 19:16:43 +00:00
server_name localhost ${DOMAIN}; #All domains
2022-12-07 08:38:02 +00:00
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
set $billing_enabled ${BILLING_ENABLED};
2022-12-07 08:38:02 +00:00
location / {
2022-12-10 14:30:39 +00:00
proxy_set_header Host $server_name;
2022-12-07 08:38:02 +00:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# If billing_enabled is true then proxy to home otherwise to dashboard because we dont need marketing paages for on-prem install.
if ($billing_enabled = true) {
proxy_pass http://home;
}
if ($billing_enabled != true) {
proxy_pass http://dashboard;
}
2022-12-07 08:38:02 +00:00
}
2022-12-07 08:38:02 +00:00
location /accounts {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-20 07:22:41 +00:00
proxy_pass http://accounts;
2022-12-07 08:38:02 +00:00
}
2023-06-06 20:23:56 +00:00
location /notification {
2022-12-30 15:05:25 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2023-06-06 20:23:56 +00:00
proxy_pass http://notification;
2022-12-30 15:05:25 +00:00
}
2023-05-02 14:29:22 +00:00
location /probe-api {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://probe-api;
client_max_body_size 50M;
}
2022-12-30 15:05:25 +00:00
location /dashboard {
2022-12-07 08:38:02 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-20 07:22:41 +00:00
proxy_pass http://dashboard;
2022-12-07 08:38:02 +00:00
}
location /status-page {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-20 07:22:41 +00:00
proxy_pass http://status-page;
2022-12-07 08:38:02 +00:00
}
location /identity {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-19 14:09:21 +00:00
proxy_pass http://identity;
2022-12-07 08:38:02 +00:00
}
2023-04-05 10:08:25 +00:00
location /reference {
2023-02-07 21:51:53 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2023-04-05 10:10:18 +00:00
proxy_pass http://api-reference;
2023-02-07 21:51:53 +00:00
}
2022-12-07 08:38:02 +00:00
location /file {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-20 07:13:36 +00:00
proxy_pass http://file;
2022-12-07 08:38:02 +00:00
client_max_body_size 50M;
}
location /api {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-20 07:13:36 +00:00
proxy_pass http://dashboard-api;
2022-12-07 08:38:02 +00:00
client_max_body_size 50M;
}
2023-02-01 13:08:45 +00:00
2023-07-29 15:21:47 +00:00
location /heartbeat {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://probe-api/incoming-request;
client_max_body_size 50M;
}
2023-02-01 13:08:45 +00:00
location /workflow {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://workflow;
client_max_body_size 50M;
}
2023-08-25 12:19:38 +00:00
location /l/ { # Short URL for Link Shortener
2023-07-01 12:08:50 +00:00
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2023-08-25 12:19:38 +00:00
proxy_pass http://link-shortener/;
2023-07-01 12:08:50 +00:00
client_max_body_size 50M;
}
2022-12-07 08:38:02 +00:00
location /workers {
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-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
2022-12-20 07:22:41 +00:00
proxy_pass http://workers;
2022-12-07 08:38:02 +00:00
}
}