Created
February 6, 2016 14:41
-
-
Save anonymous/01ba2588a4f2ed2bafa0 to your computer and use it in GitHub Desktop.
root_m
This file contains 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
user apache; | |
worker_processes 2; | |
worker_rlimit_nofile 2048; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 2048; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
server_tokens off; | |
client_max_body_size 100m; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
access_log /var/log/nginx/access.log main; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
#gzip on; | |
############################################################ | |
#GZIP | |
gzip on; | |
gzip_min_length 1000; | |
gzip_proxied expired no-cache no-store private auth; | |
gzip_types text/plain application/xml; | |
# Выделяем буфер для gzip | |
gzip_buffers 32 4k; | |
# Устанавливаем уровень сжатия, от 1-9 | |
gzip_comp_level 6; | |
# Убираем поддержку IE6 | |
gzip_disable "msie6"; | |
# Устанавливаем версию для использования gzip (1.0 или 1.1) | |
gzip_http_version 1.1; | |
# Разрешаем использовать статику | |
gzip_static on; | |
gzip_vary on; | |
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype applicatio$ | |
############################################################ | |
### | |
#GZIP | |
server_names_hash_bucket_size 128; | |
server_names_hash_max_size 1024; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 5m; | |
ssl_prefer_server_ciphers on; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
ssl_trusted_certificate "/etc/pki/tls/certs/ca-certs.pem"; | |
resolver 8.8.8.8 8.8.4.4 valid=300s; | |
resolver_timeout 5s; | |
include /etc/nginx/conf.d/*.conf; | |
# include /etc/nginx/vhosts/*.conf; | |
server { | |
server_name 127.0.0.1; | |
disable_symlinks if_not_owner; | |
listen 80; | |
include /etc/nginx/vhosts-includes/*.conf; | |
location @fallback { | |
proxy_read_timeout 900; | |
#client_header_timeout 10m; | |
client_body_timeout 10m; | |
send_timeout 10m; | |
error_log /dev/null crit; | |
proxy_pass http://127.0.0.1:8080; | |
proxy_redirect http://127.0.0.1:8080 /; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-Secret L8uHXMXyTQiO3Q83; | |
access_log off ; | |
} | |
#return 301 https://$host$request_uri; | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|js|css|txt|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ { | |
access_log off; | |
expires 8d; | |
add_header Cache-Control public; | |
break; | |
} | |
} | |
# | |
## | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment