nginx配置记录

Posted 明天后浪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx配置记录相关的知识,希望对你有一定的参考价值。

user www-data;
worker_processes 1;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
# multi_accept on;
}

http {
include /etc/nginx/mime.types;

types_hash_max_size 2048;
server_names_hash_bucket_size 64;

access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;

gzip on;
gzip_min_length 5k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 4;
gzip_types text/plain application/x-javascript text/css application/xml application/json text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

upstream backend {
server localhost:3456 ;
server localhost:4567 ;
server localhost:5678 ;
server localhost:6789 ;
}

server {
listen 80;
server_name api.caiqr.com;

location /api {
proxy_set_header Referer "";
proxy_pass http://backend/api;
client_max_body_size 10m;
}
}

server {
#listen 80;
listen 80 default_server;
root /data/caiqiu/wapBetting/src;
index index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
location /get_api_post_data/{
proxy_pass http://127.0.0.1:8888/get_api_post_data;
}
location /fragment_cache {
proxy_pass http://127.0.0.1:8888/fragment_cache;
}
location /match_data/{
proxy_pass http://127.0.0.1:8888/match_data;
}
location /match_basketball_data/{
proxy_pass http://127.0.0.1:8888/match_basketball_data;
}
}
}





















































以上是关于nginx配置记录的主要内容,如果未能解决你的问题,请参考以下文章

Nginx配置记录

Nginx配置记录

Nginx配置记录

nginx 如何配置日志不记录静态文件的访问

Nginx日志配置

Nginx配置日志格式记录cookie