Difference between revisions of "Nginx access gateway"
Jump to navigation
Jump to search
(Created page with "``` error_log /dev/stdout info; # error_log stderr; worker_processes 1; daemon off; pid /tmp/nginx.pid; events { } http { access_log /dev/stdout; upstream backend_serv...") |
|||
Line 12: | Line 12: | ||
http { | http { | ||
access_log /dev/stdout; | access_log /dev/stdout; | ||
− | |||
− | |||
− | |||
− | |||
server { | server { |
Revision as of 18:44, 1 April 2024
error_log /dev/stdout info; # error_log stderr; worker_processes 1; daemon off; pid /tmp/nginx.pid; events { } http { access_log /dev/stdout; server { listen 18443; server_name example.org; location / { if ($arg_key != "foo"){ add_header Content-Type text/plain; return 401 'Access Denied'; } proxy_pass https://example.org; # 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; } } }
nginx -t $(pwd)/nginx.conf nginx -c $(pwd)/nginx.conf