nginx设置
http
{
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 600;#为了本地调试设置大一点,原来是60
tcp_nodelay on;
#fastcgi_connect_timeout 300;
#fastcgi_send_timeout 300;
#fastcgi_read_timeout 300;
#fastcgi_buffer_size 64k;
#fastcgi_buffers 4 64k;
#fastcgi_busy_buffers_size 128k;
#fastcgi_temp_file_write_size 256k;
send_timeout 5;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
access_log off;
server
{
listen 8889;
#listen [::]:80 default_server ipv6only=on;
server_name dev.测试.com;
include /usr/local/nginx/conf/ssl/测试.com/ssl.conf;
index index.html index.htm index.php;
access_log /home/log/nginx/dev.测试.com_nginx.log;
root /home/wwwroot/default;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
# proxy_pass http://192.168.47.101:8080;
proxy_pass http://192.168.47.107:8080;
# proxy_pass http://192.168.21.38:8686;
expires 2h;
}
location ~ .*\.(js|css)?$
{
# proxy_pass http://192.168.47.101:8080;
proxy_pass http://192.168.47.107:8080;
# proxy_pass http://192.168.21.38:8686;
expires 2h;
# add_header Cache-Control no-cache;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
location ~ .*\.(js|css)?$
{
# proxy_pass http://192.168.47.101:8080;
proxy_pass http://192.168.47.107:8080;
# proxy_pass http://192.168.21.38:8686;
expires 2h;
# add_header Cache-Control no-cache;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
#location = / {
# rewrite ^/(.*) /auth ;
#}
location / {
#root /usr/local/tp_upload;
# index index.html index.htm;
proxy_set_header Host $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;
# proxy_pass http://192.168.47.101:8080;
proxy_pass http://192.168.47.107:8080;
#check test:proxy_pass http://192.168.32.113:8091;
#client_max_body_size 1000m;
# try_files $uri $uri/ /index.html;
}
access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}
- nginx缓存设置proxy_cache
- [置顶] 服务器(6)--Nginx实现HTTPS网站设置
- Nginx设置防止IP及非配置域名访问
- Nginx配置文件的常用设置(附详细说明及Nginx的proxy负载均衡、memcached负载均衡、反向代理)
- 利用nginx设置浏览器协商缓存
- nginx超时设置
- Tomcat与Apache或Nginx的集群负载均衡设置及Sersync同步应用(3)
- mac apache, nginx 设置document root 报错:403 forbidden
- nginx简单防盗链及设置默认虚拟主机
- 配置nginx反向代理时,要注意的权限设置
- nginx的缓存设置
- CentOS 6.2 安装Nginx 并设置为开机服务(补充)
- 如何正确设置nginx中remote_addr和x_forwarded_for参数
- nginx 设置自签名证书以及设置网址http强制转https访问
- 使用log_format为Nginx服务器设置更详细的日志格式
- nginx设置404 500页面跳转至首页,K哥
- php上传文件个数设置以及修改php.ini重启nginx php.ini设置不生效
- Nginx 设置域名转向配置
- Nginx设置本地浏览器缓存
- 详解nginx实现https网站设置