123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- user root;
- worker_processes 4;
- error_log /srv/nginx/logs/error.log;
- error_log /srv/nginx/logs/error.log notice;
- error_log /srv/nginx/logs/error.log info;
- pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- 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 /srv/nginx/logs/access.log main;
- sendfile on;
- #tcp_nopush on;
- keepalive_timeout 65;
- gzip on;
- gzip_min_length 1k;
- gzip_buffers 4 16k;
- gzip_types text/plain application/javascript application/x-javascript text/css application/json text/javascript
- 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_buffering on;
- proxy_buffer_size 32k;
- proxy_buffers 8 64k;
- client_max_body_size 100m;
- client_body_buffer_size 1024k;
- include /usr/local/nginx/conf/conf.d/*.conf;
- }
- # app server
- upstream appServer {
- server 127.0.0.1:8080;
- server 127.0.0.1:8081;
- }
- server {
- listen 80;
- server_name app.xxx.com;
- access_log /srv/nginx/logs/app.log main;
- location / {
- proxy_pass http://appServer;
- proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
- }
- }
- # web server
- server {
- listen 80;
- listen 443 ssl;
- server_name xxx.com www.xxx.com;
- ssl_certificate cert/www.xxx.com.pem;
- ssl_certificate_key cert/www.xxx.com.key;
- ssl_session_timeout 5m;
- ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_prefer_server_ciphers on;
- access_log /srv/nginx/logs/www.log main;
- location / {
- root /srv/html/home/;
- try_files $uri $uri/index.html @front;
- }
- location @front {
- root /srv/server/html/;
- }
- location =/apple-app-site-association {
- add_header Content-Type application/json;
- alias /srv/html/apple-app-site-association;
- }
- location =/.well-known/apple-app-site-association {
- add_header Content-Type application/json;
- alias /srv/html/apple-app-site-association;
- }
- }
|