Last active
December 9, 2022 18:14
-
-
Save miguelmota/1ab7b1e8cabd0457d7c2721062ebcae2 to your computer and use it in GitHub Desktop.
Nginx reverse proxy server with url parameter
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 80 default_server; | |
listen [::]:80 default_server; | |
access_log off; | |
resolver 8.8.8.8 ipv6=off; | |
location / { | |
proxy_pass $arg_url; | |
proxy_ssl_server_name on; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host $proxy_host; | |
proxy_cache_bypass $http_upgrade; | |
client_max_body_size 100M; | |
} | |
} |
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
docker stop nginx-proxy | |
docker rm nginx-proxy | |
docker run \ | |
--name=nginx-proxy \ | |
-p 8000:80 \ | |
-v $PWD/templates:/etc/nginx/templates/ \ | |
nginx |
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
curl "http://localhost:8000/?url=https://example.com" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment