nginx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
nginx [2020/12/27 20:35] – external edit 127.0.0.1 | nginx [2023/10/13 16:30] (current) – skipidar | ||
---|---|---|---|
Line 124: | Line 124: | ||
?> | ?> | ||
</ | </ | ||
+ | |||
+ | |||
+ | Generated config from reverse_proxy nginx | ||
+ | |||
+ | <sxh json> | ||
+ | root@f5ae19524493:/# | ||
+ | # nginx-proxy version : 1.3.0 | ||
+ | # Networks available to the container running docker-gen (which are assumed to | ||
+ | # match the networks available to the container running nginx): | ||
+ | # | ||
+ | # If we receive X-Forwarded-Proto, | ||
+ | # scheme used to connect to this server | ||
+ | map $http_x_forwarded_proto $proxy_x_forwarded_proto { | ||
+ | default $http_x_forwarded_proto; | ||
+ | '' | ||
+ | } | ||
+ | map $http_x_forwarded_host $proxy_x_forwarded_host { | ||
+ | default $http_x_forwarded_host; | ||
+ | '' | ||
+ | } | ||
+ | # If we receive X-Forwarded-Port, | ||
+ | # server port the client connected to | ||
+ | map $http_x_forwarded_port $proxy_x_forwarded_port { | ||
+ | default $http_x_forwarded_port; | ||
+ | '' | ||
+ | } | ||
+ | # If the request from the downstream client has an " | ||
+ | # non-empty value), pass " | ||
+ | # Otherwise, the value for the " | ||
+ | # has enabled keepalive to the upstream server. | ||
+ | map $http_upgrade $proxy_connection { | ||
+ | default upgrade; | ||
+ | '' | ||
+ | } | ||
+ | map $upstream_keepalive $proxy_connection_noupgrade { | ||
+ | # Preserve nginx' | ||
+ | default close; | ||
+ | # Use an empty string to cancel nginx' | ||
+ | true ''; | ||
+ | } | ||
+ | # Abuse the map directive (see < | ||
+ | # that $upstream_keepalive is always defined. | ||
+ | # - The $proxy_connection variable is indirectly derived from | ||
+ | # | ||
+ | # | ||
+ | # - The $proxy_connection variable is used in a proxy_set_header directive in | ||
+ | # the http block, so it is always fully resolved for every request -- even | ||
+ | # those where proxy_pass is not used (e.g., unknown virtual host). | ||
+ | map "" | ||
+ | # The value here should not matter because it should always be overridden in | ||
+ | # a location block (see the " | ||
+ | # value actually matters. | ||
+ | default false; | ||
+ | } | ||
+ | # Apply fix for very long server names | ||
+ | server_names_hash_bucket_size 128; | ||
+ | # Default dhparam | ||
+ | ssl_dhparam / | ||
+ | # Set appropriate X-Forwarded-Ssl header based on $proxy_x_forwarded_proto | ||
+ | map $proxy_x_forwarded_proto $proxy_x_forwarded_ssl { | ||
+ | default off; | ||
+ | https on; | ||
+ | } | ||
+ | gzip_types text/plain text/css application/ | ||
+ | log_format vhost '$host $remote_addr - $remote_user [$time_local] " | ||
+ | access_log off; | ||
+ | ssl_protocols TLSv1.2 TLSv1.3; | ||
+ | ssl_ciphers ' | ||
+ | ssl_prefer_server_ciphers off; | ||
+ | error_log / | ||
+ | resolver 127.0.0.11; | ||
+ | # HTTP 1.1 support | ||
+ | proxy_http_version 1.1; | ||
+ | proxy_buffering off; | ||
+ | proxy_set_header Host $http_host; | ||
+ | proxy_set_header Upgrade $http_upgrade; | ||
+ | proxy_set_header Connection $proxy_connection; | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host; | ||
+ | proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; | ||
+ | proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl; | ||
+ | proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port; | ||
+ | proxy_set_header X-Original-URI $request_uri; | ||
+ | # Mitigate httpoxy attack (see README for details) | ||
+ | proxy_set_header Proxy ""; | ||
+ | server { | ||
+ | server_name _; # This is just an invalid value which will never trigger on a real hostname. | ||
+ | server_tokens off; | ||
+ | listen 80; | ||
+ | listen 443 ssl http2; | ||
+ | access_log / | ||
+ | # No default.crt certificate found for this vhost, so force nginx to emit a | ||
+ | # TLS error if the client connects via https. | ||
+ | ssl_ciphers aNULL; | ||
+ | set $empty ""; | ||
+ | ssl_certificate data: | ||
+ | ssl_certificate_key data: | ||
+ | if ($https) { | ||
+ | return 444; | ||
+ | } | ||
+ | return 503; | ||
+ | } | ||
+ | # alf.digital/ | ||
+ | upstream alf.digital { | ||
+ | # Container: businesscard_s3 | ||
+ | # | ||
+ | # | ||
+ | # IP address: 172.18.0.3 | ||
+ | # | ||
+ | # | ||
+ | # using port: 8081 | ||
+ | # /!\ WARNING: Virtual port published on host. Clients | ||
+ | # might be able to bypass nginx-proxy and | ||
+ | # access the container' | ||
+ | server 172.18.0.3: | ||
+ | } | ||
+ | server { | ||
+ | server_name alf.digital; | ||
+ | listen 80 ; | ||
+ | access_log / | ||
+ | # Do not HTTPS redirect Let's Encrypt ACME challenge | ||
+ | location ^~ / | ||
+ | auth_basic off; | ||
+ | auth_request off; | ||
+ | allow all; | ||
+ | root / | ||
+ | try_files $uri =404; | ||
+ | break; | ||
+ | } | ||
+ | location / { | ||
+ | return 301 https:// | ||
+ | } | ||
+ | } | ||
+ | server { | ||
+ | server_name alf.digital; | ||
+ | access_log / | ||
+ | listen 443 ssl http2 ; | ||
+ | ssl_session_timeout 5m; | ||
+ | ssl_session_cache shared: | ||
+ | ssl_session_tickets off; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | set $sts_header ""; | ||
+ | if ($https) { | ||
+ | set $sts_header " | ||
+ | } | ||
+ | add_header Strict-Transport-Security $sts_header always; | ||
+ | location / { | ||
+ | proxy_pass http:// | ||
+ | set $upstream_keepalive false; | ||
+ | } | ||
+ | } | ||
+ | # card.alf.digital/ | ||
+ | upstream card.alf.digital { | ||
+ | # Container: businesscard_s3 | ||
+ | # | ||
+ | # | ||
+ | # IP address: 172.18.0.3 | ||
+ | # | ||
+ | # | ||
+ | # using port: 8081 | ||
+ | # /!\ WARNING: Virtual port published on host. Clients | ||
+ | # might be able to bypass nginx-proxy and | ||
+ | # access the container' | ||
+ | server 172.18.0.3: | ||
+ | } | ||
+ | server { | ||
+ | server_name card.alf.digital; | ||
+ | listen 80 ; | ||
+ | access_log / | ||
+ | # Do not HTTPS redirect Let's Encrypt ACME challenge | ||
+ | location ^~ / | ||
+ | auth_basic off; | ||
+ | auth_request off; | ||
+ | allow all; | ||
+ | root / | ||
+ | try_files $uri =404; | ||
+ | break; | ||
+ | } | ||
+ | location / { | ||
+ | return 301 https:// | ||
+ | } | ||
+ | } | ||
+ | server { | ||
+ | server_name card.alf.digital; | ||
+ | access_log / | ||
+ | listen 443 ssl http2 ; | ||
+ | ssl_session_timeout 5m; | ||
+ | ssl_session_cache shared: | ||
+ | ssl_session_tickets off; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | set $sts_header ""; | ||
+ | if ($https) { | ||
+ | set $sts_header " | ||
+ | } | ||
+ | add_header Strict-Transport-Security $sts_header always; | ||
+ | location / { | ||
+ | proxy_pass http:// | ||
+ | set $upstream_keepalive false; | ||
+ | } | ||
+ | } | ||
+ | # wiki.alf.digital/ | ||
+ | upstream wiki.alf.digital { | ||
+ | # Container: wiki_localhost | ||
+ | # | ||
+ | # | ||
+ | # IP address: 172.18.0.2 | ||
+ | # | ||
+ | # | ||
+ | # using port: 8080 | ||
+ | # /!\ WARNING: Virtual port published on host. Clients | ||
+ | # might be able to bypass nginx-proxy and | ||
+ | # access the container' | ||
+ | server 172.18.0.2: | ||
+ | } | ||
+ | server { | ||
+ | server_name wiki.alf.digital; | ||
+ | listen 80 ; | ||
+ | access_log / | ||
+ | # Do not HTTPS redirect Let's Encrypt ACME challenge | ||
+ | location ^~ / | ||
+ | auth_basic off; | ||
+ | auth_request off; | ||
+ | allow all; | ||
+ | root / | ||
+ | try_files $uri =404; | ||
+ | break; | ||
+ | } | ||
+ | location / { | ||
+ | return 301 https:// | ||
+ | } | ||
+ | } | ||
+ | server { | ||
+ | server_name wiki.alf.digital; | ||
+ | access_log / | ||
+ | listen 443 ssl http2 ; | ||
+ | ssl_session_timeout 5m; | ||
+ | ssl_session_cache shared: | ||
+ | ssl_session_tickets off; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | set $sts_header ""; | ||
+ | if ($https) { | ||
+ | set $sts_header " | ||
+ | } | ||
+ | add_header Strict-Transport-Security $sts_header always; | ||
+ | location / { | ||
+ | proxy_pass http:// | ||
+ | set $upstream_keepalive false; | ||
+ | } | ||
+ | } | ||
+ | # www.alf.digital/ | ||
+ | upstream www.alf.digital { | ||
+ | # Container: businesscard_s3 | ||
+ | # | ||
+ | # | ||
+ | # IP address: 172.18.0.3 | ||
+ | # | ||
+ | # | ||
+ | # using port: 8081 | ||
+ | # /!\ WARNING: Virtual port published on host. Clients | ||
+ | # might be able to bypass nginx-proxy and | ||
+ | # access the container' | ||
+ | server 172.18.0.3: | ||
+ | } | ||
+ | server { | ||
+ | server_name www.alf.digital; | ||
+ | listen 80 ; | ||
+ | access_log / | ||
+ | # Do not HTTPS redirect Let's Encrypt ACME challenge | ||
+ | location ^~ / | ||
+ | auth_basic off; | ||
+ | auth_request off; | ||
+ | allow all; | ||
+ | root / | ||
+ | try_files $uri =404; | ||
+ | break; | ||
+ | } | ||
+ | location / { | ||
+ | return 301 https:// | ||
+ | } | ||
+ | } | ||
+ | server { | ||
+ | server_name www.alf.digital; | ||
+ | access_log / | ||
+ | listen 443 ssl http2 ; | ||
+ | ssl_session_timeout 5m; | ||
+ | ssl_session_cache shared: | ||
+ | ssl_session_tickets off; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | set $sts_header ""; | ||
+ | if ($https) { | ||
+ | set $sts_header " | ||
+ | } | ||
+ | add_header Strict-Transport-Security $sts_header always; | ||
+ | location / { | ||
+ | proxy_pass http:// | ||
+ | set $upstream_keepalive false; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
nginx.1609101328.txt.gz · Last modified: by 127.0.0.1