Skip to content

Instantly share code, notes, and snippets.

@amanjuman
Created June 11, 2020 09:35
Show Gist options
  • Save amanjuman/98316839d2a7c4c20a8cce6f8b3a4bff to your computer and use it in GitHub Desktop.
Save amanjuman/98316839d2a7c4c20a8cce6f8b3a4bff to your computer and use it in GitHub Desktop.
pgadmin4 Nginx Reverse Config
server
{
# Listen
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Directory & Server Naming
server_name subdomain.example.com;
http2_push_preload on;
# HTTP to HTTPS redirection
if ($scheme != "https")
{
return 301 https://$host$request_uri;
}
# SSL
ssl_certificate /etc/letsencrypt/live/subdomain.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/subdomain.example.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/subdomain.example.com/fullchain.pem;
# Disable Hidden FIle Access Except Lets Encrypt Verification
location ~ /\.well-known
{
allow all;
}
# Nginx Logging
access_log /var/log/nginx/subdomain.example.com-access.log;
error_log /var/log/nginx/subdomain.example.com-error.log warn;
# Max Upload Size
client_max_body_size 100M;
access_log off;
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 https;
proxy_pass http://127.0.0.1:5050;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment