Files
nginx/sites-available/default

177 lines
4.9 KiB
Plaintext

#
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
# Default should define all the routes to upgrade to https and global rules!
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name *.leifsopplevelser.no ruterna.no textbars.app *.kevinmidboe.com kevinmidboe.com;
return 302 https://$host$request_uri;
}
server {
listen 443;
server_name sonarr.kevinmidboe.com;
location / {
proxy_pass http://10.0.0.102:8989;
}
ssl_certificate /etc/letsencrypt/live/sonarr.kevinmidboe.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/sonarr.kevinmidboe.com/privkey.pem; # managed by Certbot
}
server {
listen 443;
server_name tau.kevinmidboe.com;
location / {
proxy_pass http://10.0.0.44:8181;
}
ssl_certificate /etc/letsencrypt/live/tau.kevinmidboe.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/tau.kevinmidboe.com/privkey.pem; # managed by Certbot
}
server {
listen 443;
server_name xoa.kevinmidboe.com;
location / {
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;
# Proxy configuration
proxy_pass http://10.0.0.43/;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_redirect default;
# Issue https://github.com/vatesfr/xen-orchestra/issues/1471
proxy_read_timeout 1800; # Error will be only every 30m
# For the VM import feature, this size must be larger than the file we want to upload.
# Without a proper value, nginx will have error "client intended to send too large body"
client_max_body_size 4G;
}
ssl_certificate /etc/letsencrypt/live/xoa.kevinmidboe.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xoa.kevinmidboe.com/privkey.pem; # managed by Certbot
}
server {
listen 443;
server_name dev.kevinmidboe.com;
location / {
proxy_pass http://localhost:11001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 443;
listen [::]:443;
server_name kevinmidboe.com;
root /usr/share/nginx/html/;
location /jobb {
index index.html;
}
location /km {
index index.html plex.html;
}
location /seasoned {
index index.html verified.html;
}
location /seasonedUI {
index index.html;
}
location /vibrate {
index index.html;
}
location /assets {
alias /www/data/assets;
autoindex on;
}
location /clipboard {
index index.html;
}
location /shows {
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin "https://kevinmidboe.com";
add_header Access-Control-Allow-Methods "GET, OPTIONS, POST";
add_header 'Access-Control-Allow-Headers' 'Content-Type';
return 200;
}
proxy_pass http://10.0.0.115:9301;
}
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 502 /502.html;
location = /502.html {
root /home/kevin;
}
ssl_certificate /etc/letsencrypt/live/kevinmidboe.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/kevinmidboe.com/privkey.pem; # managed by Certbot
}