Last active
April 22, 2022 17:54
-
-
Save kirillzhosul/9e88a04eb3d13d422fa179c6e8bf31a4 to your computer and use it in GitHub Desktop.
NGINX Proxy config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Keep as-is. | |
events { | |
worker_connections 1024; | |
} | |
http { | |
# Keep as-is. | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
# This is should be used for SSL/HTTPS. | |
# ssl_certificate common.crt; | |
# ssl_certificate_key common.key; | |
# Base forbidden / other redirect. | |
server { | |
listen 80; | |
# listen 443 ssl; | |
server_name localhost; | |
return 403; # Simple forbidden behaviour. | |
# return 301 http://redirect.to # Redirect behaviour | |
} | |
# Our server. | |
server { | |
listen 80; | |
# listen 443 ssl; | |
server_name domain.here.to; | |
location / { | |
proxy_pass http://127.0.0.1:10001/; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
} | |
# Copy server block above and change proxy port + domain name. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment