Webcontrat - Serveurs Web : Différence entre versions
(→Nginx) |
(→Nginx) |
||
| Ligne 22 : | Ligne 22 : | ||
## | ## | ||
| − | + | sendfile on; | |
| − | + | tcp_nopush on; | |
| − | + | tcp_nodelay on; | |
| − | + | keepalive_timeout 65; | |
| − | + | types_hash_max_size 2048; | |
# server_tokens off; | # server_tokens off; | ||
| − | + | # server_names_hash_bucket_size 64; | |
| − | + | # server_name_in_redirect off; | |
| − | + | include /etc/nginx/mime.types; | |
| − | + | default_type application/octet-stream; | |
| − | + | client_max_body_size 500M; # allows file uploads up to 500 megabytes | |
| − | + | # Accepter les underscore dans les headers | |
| − | + | underscores_in_headers on; | |
# real_ip_header $HTTP_X_FORWARDED_FOR; | # real_ip_header $HTTP_X_FORWARDED_FOR; | ||
# set_real_ip_from 0.0.0.0; | # set_real_ip_from 0.0.0.0; | ||
| − | + | ## | |
| − | + | # SSL Settings | |
| − | + | ## | |
| − | + | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE | |
| − | + | ssl_prefer_server_ciphers on; | |
| − | + | ## | |
| − | + | # Logging Settings | |
| − | + | ## | |
| − | + | ## This log format makes it so we can see real requester's IP address \ | |
| − | + | ## not just the reverse proxy server's IP address. Also note, that \ | |
| − | + | ## "specialLog" can be replaced with any name you would like to \ | |
| − | + | ## give to this log format. | |
| − | + | log_format specialLog '$remote_addr forwarded for $HTTP_X_FORWARDED_FOR - $HTTP_EPPN [$time_local] ' | |
| − | + | '"$request" $status $body_bytes_sent ' | |
| − | + | '"$http_referer" "$http_user_agent"'; | |
| − | + | access_log syslog:server=10.30.0.200,tag=nginx_access specialLog; | |
| − | + | error_log syslog:server=10.30.0.200,tag=nginx_error; | |
| − | + | access_log /var/log/nginx/access.log specialLog; | |
| − | + | error_log /var/log/nginx/error.log; | |
| − | + | ## | |
| − | + | # Gzip Settings | |
| − | + | ## | |
| − | + | gzip on; | |
| − | + | gzip_disable "msie6"; | |
| − | + | gzip_vary on; | |
| − | + | gzip_min_length 10240; | |
| − | + | gzip_proxied expired no-cache no-store private auth; | |
| − | + | # gzip_comp_level 6; | |
| − | + | # gzip_buffers 16 8k; | |
| − | + | # gzip_http_version 1.1; | |
| − | + | gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | |
| − | + | ## | |
| − | + | # nginx-naxsi config | |
| − | + | ## | |
| − | + | # Uncomment it if you installed nginx-naxsi | |
| − | + | ## | |
| − | + | #include /etc/nginx/naxsi_core.rules; | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | ## | ||
| + | # Virtual Host Configs | ||
| + | ## | ||
| + | include /etc/nginx/conf.d/*.conf; | ||
| + | include /etc/nginx/sites-enabled/*; | ||
} | } | ||
Version du 19 août 2015 à 10:30
Les serveurs Webs terminaux tournent sous Nginx / php-fpm
Nginx
/etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 8096;
multi_accept on;
use epoll;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 500M; # allows file uploads up to 500 megabytes
# Accepter les underscore dans les headers
underscores_in_headers on;
# real_ip_header $HTTP_X_FORWARDED_FOR;
# set_real_ip_from 0.0.0.0;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
## This log format makes it so we can see real requester's IP address \
## not just the reverse proxy server's IP address. Also note, that \
## "specialLog" can be replaced with any name you would like to \
## give to this log format.
log_format specialLog '$remote_addr forwarded for $HTTP_X_FORWARDED_FOR - $HTTP_EPPN [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log syslog:server=10.30.0.200,tag=nginx_access specialLog;
error_log syslog:server=10.30.0.200,tag=nginx_error;
access_log /var/log/nginx/access.log specialLog;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}