Reverse Proxy

Setup reverse Proxy

Nginx

Subdomain

server {
    listen 80;
    server_name shinkro.domain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name shinkro.domain.com;

    include snippets/ssl-params.conf;

    ssl_certificate /etc/nginx/ssl/shinkro.domain.com/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/shinkro.domain.com/key.pem;

    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_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    
    location / {
        proxy_pass http://127.0.0.1:7011;
    }
}

Subfolder

Remember to set shinkro.BaseUrl = "/shinkro" in config.toml if you plan to set it up as a subfolder.

location /shinkro/ {
  proxy_pass         http://127.0.0.1:7011/shinkro/;
  proxy_set_header   Host $host;
  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header   X-Forwarded-Host $host;
  proxy_set_header   X-Forwarded-Proto $scheme;
  proxy_redirect     off;
  proxy_http_version 1.1;
  proxy_set_header   Upgrade $http_upgrade;
  proxy_set_header   Connection $http_connection;
}

Last updated