Last active
March 10, 2021 09:39
-
-
Save ilhamarrouf/c4022c2a2b98c1ec8f735fff4a15632b to your computer and use it in GitHub Desktop.
Nginx Config
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
| # For more information on configuration, see: | |
| # * Official English Documentation: http://nginx.org/en/docs/ | |
| # * Official Russian Documentation: http://nginx.org/ru/docs/ | |
| user nginx; | |
| worker_processes auto; | |
| error_log /var/log/nginx/error.log; | |
| pid /run/nginx.pid; | |
| # Load dynamic modules. See /usr/share/nginx/README.dynamic. | |
| include /usr/share/nginx/modules/*.conf; | |
| events { | |
| worker_connections 65536; | |
| use epoll; | |
| multi_accept on; | |
| } | |
| http { | |
| log_format main_ext '$remote_addr - $remote_user [$time_local] "$request" ' | |
| '$status $body_bytes_sent "$http_referer" ' | |
| '"$http_user_agent" "$http_x_forwarded_for" ' | |
| '"$host" sn="$server_name" ' 'rt=$request_time ' | |
| 'ua="$upstream_addr" us="$upstream_status" ' | |
| 'ut="$upstream_response_time" ul="$upstream_response_length" ' | |
| 'cs=$upstream_cache_status' ; | |
| access_log /var/log/nginx/access.log main_ext; | |
| sendfile on; | |
| tcp_nopush on; | |
| tcp_nodelay on; | |
| keepalive_timeout 65; | |
| keepalive_requests 100000; | |
| types_hash_max_size 2048; | |
| client_max_body_size 64M; | |
| server_tokens off; | |
| client_body_buffer_size 128k; | |
| client_header_buffer_size 1k; | |
| large_client_header_buffers 4 4k; | |
| output_buffers 1 32k; | |
| postpone_output 1460; | |
| client_header_timeout 3m; | |
| client_body_timeout 3m; | |
| send_timeout 3m; | |
| open_file_cache max=1000 inactive=20s; | |
| open_file_cache_valid 30s; | |
| open_file_cache_min_uses 5; | |
| open_file_cache_errors off; | |
| add_header X-Cache $upstream_cache_status; | |
| include /etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| proxy_connect_timeout 300; | |
| proxy_send_timeout 300; | |
| proxy_read_timeout 300; | |
| # Load modular configuration files from the /etc/nginx/conf.d directory. | |
| # See http://nginx.org/en/docs/ngx_core_module.html#include | |
| # for more information. | |
| include /etc/nginx/conf.d/*.conf; | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| server_name _; | |
| root /usr/share/nginx/html/default/; | |
| # Load configuration files for the default server block. | |
| include /etc/nginx/default.d/*.conf; | |
| location / { | |
| } | |
| location ~ \.php$ { | |
| try_files $uri =404; | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| include fastcgi_params; | |
| } | |
| error_page 404 /404.html; | |
| location = /40x.html { | |
| } | |
| error_page 500 502 503 504 /50x.html; | |
| location = /50x.html { | |
| } | |
| } | |
| ## | |
| # Gzip Settings | |
| ## | |
| gzip on; | |
| gzip_disable "msie6"; | |
| gzip_vary on; | |
| gzip_proxied any; | |
| gzip_comp_level 9; | |
| gzip_buffers 16 8k; | |
| gzip_http_version 1.1; | |
| gzip_min_length 256; | |
| gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | |
| # Settings for a TLS enabled server. | |
| # | |
| # server { | |
| # listen 443 ssl http2 default_server; | |
| # listen [::]:443 ssl http2 default_server; | |
| # server_name _; | |
| # root /usr/share/nginx/html; | |
| # | |
| # ssl_certificate "/etc/pki/nginx/server.crt"; | |
| # ssl_certificate_key "/etc/pki/nginx/private/server.key"; | |
| # ssl_session_cache shared:SSL:1m; | |
| # ssl_session_timeout 10m; | |
| # ssl_ciphers HIGH:!aNULL:!MD5; | |
| # ssl_prefer_server_ciphers on; | |
| # | |
| # # Load configuration files for the default server block. | |
| # include /etc/nginx/default.d/*.conf; | |
| # | |
| # location / { | |
| # } | |
| # | |
| # error_page 404 /404.html; | |
| # location = /40x.html { | |
| # } | |
| # | |
| # error_page 500 502 503 504 /50x.html; | |
| # location = /50x.html { | |
| # } | |
| # } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment