287 lines
9.2 KiB
Nginx Configuration File
287 lines
9.2 KiB
Nginx Configuration File
|
|
#user nobody;
|
|
worker_processes 1;
|
|
|
|
#error_log logs/error.log;
|
|
#error_log logs/error.log notice;
|
|
#error_log 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 logs/access.log main;
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
#keepalive_timeout 0;
|
|
keepalive_timeout 65;
|
|
|
|
#gzip on;
|
|
#gzip on;
|
|
server {
|
|
listen 80 default_server;
|
|
server_name "";
|
|
server_name_in_redirect off;
|
|
|
|
location / {
|
|
proxy_pass http://tj-wzjkjww.icpkuaiban.net/;
|
|
proxy_set_header Host tj-wzjkjww.icpkuaiban.net;
|
|
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_redirect off;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name wzj.net.cn www.wzj.net.cn;
|
|
|
|
location / {
|
|
return 301 https://wzj.net.cn;
|
|
}
|
|
}
|
|
server {
|
|
listen 80;
|
|
server_name cjh.wuzhongjie.com.cn;
|
|
|
|
location / {
|
|
proxy_pass http://43.143.227.203:7002;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
}
|
|
server {
|
|
listen 80;
|
|
server_name fxh.wuzhongjie.com.cn;
|
|
|
|
location / {
|
|
proxy_pass http://43.143.227.203:7002;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
}
|
|
server {
|
|
listen 80;
|
|
server_name dev.wuzhongjie.com.cn;
|
|
|
|
location / {
|
|
proxy_pass http://43.143.227.203:7002;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
}
|
|
server {
|
|
listen 80;
|
|
server_name wuzhongjie.com.cn www.wuzhongjie.com.cn;
|
|
#charset koi8-r;
|
|
|
|
#access_log logs/host.access.log main;
|
|
|
|
location / {
|
|
alias /etc/nginx/html;
|
|
index index.html;
|
|
try_files $uri $uri/ /admin/index.html;
|
|
}
|
|
location /dev {
|
|
root dist ;
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
location /prod-api/ {
|
|
proxy_pass http://43.143.227.203:8880/;
|
|
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;
|
|
}
|
|
location /upload/file/ {
|
|
alias /var/local/upload/file/;
|
|
add_header Access-Control-Allow-Origin *;
|
|
add_header Access-Control-Allow-Methods 'GET, POST'; # 允许的HTTP方法
|
|
add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
|
add_header Access-Control-Expose-Headers 'Content-Length,Content-Range';
|
|
}
|
|
|
|
|
|
#error_page 404 /404.html;
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
#
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
|
|
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
|
#
|
|
#location ~ \.php$ {
|
|
# proxy_pass http://127.0.0.1;
|
|
#}
|
|
|
|
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
|
|
#
|
|
#location ~ \.php$ {
|
|
# root html;
|
|
# fastcgi_pass 127.0.0.1:9000;
|
|
# fastcgi_index index.php;
|
|
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
|
|
# include fastcgi_params;
|
|
#}
|
|
|
|
# deny access to .htaccess files, if Apache's document root
|
|
# concurs with nginx's one
|
|
#
|
|
#location ~ /\.ht {
|
|
# deny all;
|
|
#}
|
|
}
|
|
|
|
|
|
# another virtual host using mix of IP-, name-, and port-based configuration
|
|
#
|
|
#server {
|
|
# listen 8000;
|
|
# listen somename:8080;
|
|
# server_name somename alias another.alias;
|
|
|
|
# location / {
|
|
# root html;
|
|
# index index.html index.htm;
|
|
# }
|
|
#}
|
|
|
|
|
|
# HTTPS server
|
|
#
|
|
server {
|
|
listen 443 ssl;
|
|
server_name wuzhongjie.com.cn www.wuzhongjie.com.cn ;
|
|
|
|
ssl_certificate /etc/nginx/cert/wuzhongjie.com.cn_bundle.pem;
|
|
ssl_certificate_key /etc/nginx/cert/wuzhongjie.com.cn.key;
|
|
ssl_session_timeout 5m;
|
|
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
|
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
# 设置 gzip 压缩
|
|
gzip on;
|
|
#gzip_static on;
|
|
gzip_types text/plain text/css application/javascript application/json;
|
|
gzip_min_length 256;
|
|
location / {
|
|
proxy_pass http://tj-wzjkjww.icpkuaiban.net/;
|
|
proxy_set_header Host tj-wzjkjww.icpkuaiban.net;
|
|
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_redirect off;
|
|
}
|
|
|
|
location ^~ /admin {
|
|
alias /etc/nginx/html;
|
|
index index.html;
|
|
try_files $uri $uri/ /admin/index.html;
|
|
|
|
}
|
|
location /.well-known/apple-app-site-association {
|
|
alias /data/wzj/ioslink/.well-known/apple-app-site-association;
|
|
default_type application/json;
|
|
}
|
|
location ^~ /download/ {
|
|
alias /data/wzj/download/;
|
|
sendfile on;
|
|
autoindex_exact_size on;
|
|
charset utf-8,gbk;
|
|
#default_type application/vnd.android.package-archive;
|
|
#add_header Content-Disposition 'attachment';
|
|
}
|
|
|
|
|
|
location ^~ /busniess {
|
|
alias /data/nginx/wzj/busniess/;
|
|
index index.html;
|
|
try_files $uri $uri/ /busniess/index.html;
|
|
}
|
|
location ^~ /file/ {
|
|
proxy_pass http://43.143.227.203:9000/;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
client_max_body_size 100M;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
# app分享
|
|
location ^~ /spa {
|
|
alias /data/wzj/download/spa;
|
|
index index.html;
|
|
try_files $uri $uri/ /download/spa/index.html;
|
|
}
|
|
# app分享-接口代理
|
|
location /prod-api/ {
|
|
proxy_pass http://43.143.227.203:8880/;
|
|
client_max_body_size 100M;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
location /txvideo {
|
|
proxy_pass http://127.0.0.1:8888/cms/vlog/vodCallBack;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
}
|
|
server {
|
|
listen 443 ssl;
|
|
server_name www.wzj.net.cn wzj.net.cn;
|
|
|
|
ssl_certificate /etc/nginx/cert/wzjnetcn/wzj.net.cn.pem;
|
|
ssl_certificate_key /etc/nginx/cert/wzjnetcn/wzj.net.cn.key;
|
|
|
|
location / {
|
|
proxy_pass http://tj-wzjkjww.icpkuaiban.net/;
|
|
proxy_set_header Host tj-wzjkjww.icpkuaiban.net;
|
|
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_redirect off;
|
|
}
|
|
}
|
|
server {
|
|
listen 443 ssl;
|
|
ssl_certificate /etc/nginx/cert/wuzhongjie.com.cn_bundle.pem;
|
|
ssl_certificate_key /etc/nginx/cert/wuzhongjie.com.cn.key;
|
|
ssl_session_timeout 5m;
|
|
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
|
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
# 设置 gzip 压缩
|
|
gzip on;
|
|
#gzip_static on;
|
|
gzip_types text/plain text/css application/javascript application/json;
|
|
gzip_min_length 256;
|
|
server_name cjh.wuzhongjie.com.cn;
|
|
|
|
location / {
|
|
proxy_pass http://43.143.227.203:7002;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|