Created
December 25, 2023 14:05
-
-
Save mrl22/06ad3baddbc1bc496114c4855d9933af to your computer and use it in GitHub Desktop.
Nginx Proxy, Hide the real server
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
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name myrealdomain.com; | |
ssl_certificate_by_lua_block { | |
auto_ssl:ssl_certificate() | |
} | |
ssl_certificate /etc/ssl/resty-auto-ssl-fallback.crt; | |
ssl_certificate_key /etc/ssl/resty-auto-ssl-fallback.key; | |
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_ssl_session_reuse on; | |
proxy_send_timeout 300s; | |
proxy_pass https://hiddendomain-or-ip.com; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment