Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 73 additions & 68 deletions nginx/filesystem/etc/nginx/conf.d/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,99 +25,104 @@ server {
font/otf
font/ttf
image/svg+xml
image/x-icon
image/x-icon
text/css
text/javascript
text/plain
text/xml;

listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/certs/certificate.pem;
ssl_certificate /etc/nginx/certs/certificate.pem;
ssl_certificate_key /etc/nginx/certs/certificate.private.pem;
# issue with ip and the nginx proxy
real_ip_header X-Forwarded-For;
set_real_ip_from 172.17.0.0/16;

# issue with ip and the nginx proxy
real_ip_header X-Forwarded-For;
set_real_ip_from 172.17.0.0/16;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
root /usr/share/nginx/html;
# First attempt to serve request as file, then
# as directory, then redirect to index(angular) if no file found.
try_files $uri $uri/ /index.html;
location / {
root /usr/share/nginx/html;
# First attempt to serve request as file, then
# as directory, then redirect to index(angular) if no file found.
try_files $uri $uri/ /index.html;
}
location /api/v1 {
proxy_pass http://${IP_ADDRESS}:8081;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
# Headers required for web socket connections
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /null/v1 {
proxy_pass http://${IP_ADDRESS}:8083;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
location /twitch-bot/v1 {
proxy_pass http://${IP_ADDRESS}:8086;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
location /github-webhook {
proxy_pass http://${IP_ADDRESS}:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
location /multibranch-webhook-trigger {
proxy_pass http://${IP_ADDRESS}:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
# Verification for our SSL certificate with Let's Encrypt
location /.well-known {
root /usr/share/nginx/html;
# First attempt to serve request as file, then
# as directory, then redirect to index(angular) if no file found.
try_files $uri =404;

location /api/v1 {
proxy_pass http://${IP_ADDRESS}:8081;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
# Headers required for web socket connections
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

location /null/v1 {
proxy_pass http://${IP_ADDRESS}:8083;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}

location /twitch-bot/v1 {
proxy_pass http://${IP_ADDRESS}:8086;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}

location /github-webhook {
proxy_pass http://${IP_ADDRESS}:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}

location /multibranch-webhook-trigger {
proxy_pass http://${IP_ADDRESS}:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}

# Verification for our SSL certificate with Let's Encrypt
location /.well-known {
root /usr/share/nginx/html;
# First attempt to serve request as file, then
# as directory, then redirect to index(angular) if no file found.
try_files $uri =404;
}

error_page 404 /404.html;
location ~ 404 {
root /usr/share/nginx/html;
try_files /404.html =404;
}
location ~ 404.html {
root /usr/share/nginx/html;
try_files /404.html =404;
}

location ~ 404 {
root /usr/share/nginx/html;
try_files /404.html =404;
}

location ~ 404.html {
root /usr/share/nginx/html;
try_files /404.html =404;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# Google search picked up things that don't exist, we need to get rid of them here
location /angular {
return 404;
}
}

server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
}