|
| 1 | +user www-data; |
| 2 | +worker_processes 2; |
| 3 | +pid /run/nginx.pid; |
| 4 | +include /etc/nginx/modules-enabled/*.conf; |
| 5 | + |
| 6 | + worker_rlimit_nofile 10240; |
| 7 | + |
| 8 | +events { |
| 9 | + worker_connections 10240; |
| 10 | + multi_accept on; |
| 11 | + use epoll; |
| 12 | +} |
| 13 | + |
| 14 | +http { |
| 15 | + |
| 16 | +# GEO IP BLOCK DOMAIN |
| 17 | +geoip_country /usr/share/GeoIP/GeoIP.dat; |
| 18 | + map $geoip_country_code $allowed_country { |
| 19 | + default yes; |
| 20 | + CN no; #China |
| 21 | +# RU no; #Russia |
| 22 | +# HK no; #Hong Kong |
| 23 | +# IN no; #India |
| 24 | +# IR no; #Iran |
| 25 | +# VN no; #Vietnam |
| 26 | +# TR no; #Turkey |
| 27 | +# EG no; #Egypt |
| 28 | +# MX no; #Mexico |
| 29 | +# JP no; #Japan |
| 30 | +# KR no; #South Korea |
| 31 | +# KP no; #North Korea :) |
| 32 | +# PE no; #Peru |
| 33 | +# BR no; #Brazil |
| 34 | +# UA no; #Ukraine |
| 35 | +# ID no; #Indonesia |
| 36 | +# TH no; #Thailand |
| 37 | + } |
| 38 | + |
| 39 | +# To activate GEO BLOCK, add this in the default conf: |
| 40 | +# COUNTRY GEO BLOCK |
| 41 | +# if ($allowed_country = no) { |
| 42 | +# return 444; |
| 43 | +# } |
| 44 | + |
| 45 | + |
| 46 | + ## |
| 47 | + # Basic Settings |
| 48 | + ## |
| 49 | + |
| 50 | + sendfile on; |
| 51 | + tcp_nopush on; |
| 52 | + tcp_nodelay on; |
| 53 | + keepalive_timeout 65; |
| 54 | + types_hash_max_size 2048; |
| 55 | + server_tokens off; |
| 56 | + client_body_timeout 10; |
| 57 | + client_header_timeout 10; |
| 58 | + client_header_buffer_size 128; |
| 59 | + |
| 60 | + # server_names_hash_bucket_size 64; |
| 61 | + # server_name_in_redirect off; |
| 62 | + |
| 63 | + include /etc/nginx/mime.types; |
| 64 | + default_type application/octet-stream; |
| 65 | + |
| 66 | + ## |
| 67 | + # SSL Settings |
| 68 | + ## |
| 69 | + |
| 70 | + ssl_early_data on; |
| 71 | + ssl_protocols TLSv1.2 TLSv1.3; |
| 72 | + ssl_ciphers TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; |
| 73 | + ssl_prefer_server_ciphers on; |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + ## |
| 78 | + # Logging Settings |
| 79 | + ## |
| 80 | + |
| 81 | + access_log /var/log/nginx/access.log; |
| 82 | + error_log /var/log/nginx/error.log; |
| 83 | + |
| 84 | + ## |
| 85 | + # Gzip Settings |
| 86 | + ## |
| 87 | + |
| 88 | + gzip on; |
| 89 | + gzip_disable "msie6"; |
| 90 | + |
| 91 | + # gzip_vary on; |
| 92 | + # gzip_proxied any; |
| 93 | + # gzip_comp_level 6; |
| 94 | + gzip_buffers 16 8k; |
| 95 | + # gzip_http_version 1.1; |
| 96 | + # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; |
| 97 | + |
| 98 | + ## |
| 99 | + # Virtual Host Configs |
| 100 | + ## |
| 101 | + |
| 102 | + include /etc/nginx/conf.d/*.conf; |
| 103 | + include /etc/nginx/sites-enabled/*; |
| 104 | +} |
| 105 | + |
| 106 | + |
| 107 | +#mail { |
| 108 | +# # See sample authentication script at: |
| 109 | +# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript |
| 110 | +# |
| 111 | +# # auth_http localhost/auth.php; |
| 112 | +# # pop3_capabilities "TOP" "USER"; |
| 113 | +# # imap_capabilities "IMAP4rev1" "UIDPLUS"; |
| 114 | +# |
| 115 | +# server { |
| 116 | +# listen localhost:110; |
| 117 | +# protocol pop3; |
| 118 | +# proxy on; |
| 119 | +# } |
| 120 | +# |
| 121 | +# server { |
| 122 | +# listen localhost:143; |
| 123 | +# protocol imap; |
| 124 | +# proxy on; |
| 125 | +# } |
| 126 | +#} |
0 commit comments