- fastcgi.conf
- reverse-proxy-domain.com.conf
- tcp-proxy.conf
- letsencrypt_params
- proxy_params
Created
December 15, 2020 06:04
-
-
Save bilalatli/3a043f0b9c6282da37b32eb14a60ca98 to your computer and use it in GitHub Desktop.
NGINX - Configurations
This file contains hidden or 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
| fastcgi_param QUERY_STRING $query_string; | |
| fastcgi_param REQUEST_METHOD $request_method; | |
| fastcgi_param CONTENT_TYPE $content_type; | |
| fastcgi_param CONTENT_LENGTH $content_length; | |
| fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
| fastcgi_param REQUEST_URI $request_uri; | |
| fastcgi_param DOCUMENT_URI $document_uri; | |
| fastcgi_param DOCUMENT_ROOT $document_root; | |
| fastcgi_param SERVER_PROTOCOL $server_protocol; | |
| fastcgi_param GATEWAY_INTERFACE CGI/1.1; | |
| fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; | |
| fastcgi_param REMOTE_ADDR $remote_addr; | |
| fastcgi_param REMOTE_PORT $remote_port; | |
| fastcgi_param SERVER_ADDR $server_addr; | |
| fastcgi_param SERVER_PORT $server_port; | |
| fastcgi_param SERVER_NAME $server_name; | |
| fastcgi_index index.php; | |
| fastcgi_param REDIRECT_STATUS 200; |
This file contains hidden or 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
| # Certbot - Webroot authentication configuration for nginx | |
| # Include config `include letsencrypt_params;` | |
| # Nginx configuration test `nginx -t` | |
| # Nginx restart `systemctl restart nginx` | |
| location '/.well-known/acme-challenge' { | |
| default_type "text/plain"; | |
| root /web/letsencrypt; | |
| } |
This file contains hidden or 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
| proxy_set_header Host $http_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; |
This file contains hidden or 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
| # Reverse Proxy | |
| server { | |
| listen 80; | |
| server_name domain.com; | |
| access_log off; | |
| error_log /var/log/nginx/domain-error.log | |
| location / { | |
| # include /etc/nginx/proxy_params | |
| proxy_pass http://127.0.0.1:8080; | |
| } | |
| } |
This file contains hidden or 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
| # Layer-4 TCP/UDP Proxy | |
| stream { | |
| # Proxy name & Proxy target | |
| upstream proxyname { | |
| # server {proxy_target}:3000; | |
| server 127.0.0.1:3000; | |
| } | |
| # Source Port & Allow/Block IP's & Forward | |
| server { | |
| # Listen Port | |
| listen 13000; | |
| # Include allowed / blocked ips | |
| # include allowed_ips; | |
| # Forward upstream proxyname | |
| proxy_pass proxyname; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment