Nginx的一次优化前端打包过大的配置
#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;
server
{
listen 8899;
server_name 47.99.116.65,localhost;
gzip on;
gzip_buffers 32 4K;
gzip_comp_level 6;
gzip_min_length 100;
gzip_types application/javascript text/css text/xml;
gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件,支持正则。此处表示ie6及以下不启用gzip(因为ie低版本不支持)
gzip_vary on;
location /geoconv/ {
proxy_pass http://api.map.baidu.com/geoconv/;
}
location /fives.web {
proxy_pass http://localhost:8293/fives.web;
}
location /git {
proxy_pass http://localhost:80/git;
}
location /5s.api {
proxy_pass http://localhost:8293/5s.api;
}
location /flowrest {
proxy_pass http://localhost:8294/flowrest;
}
location /fives.reports {
proxy_pass http://localhost:8293/FiveS.Web/Fives.Reports;
}
location /mag/hls/ {
proxy_pass http://qms.yiulian.com:8090/mag/hls/;
gzip_proxied off;
}
access_log logs/xxx456.tk_access.log;
}
server
{
listen 8891;
server_name 47.99.116.65,localhost;
location /fives.web/ {
proxy_pass http://localhost:8193/fives.web/;
}
location /5s.api/ {
proxy_pass http://localhost:8193/5s.api/;
}
location /fives.reports/ {
proxy_pass http://localhost:8193/FiveS.Web/Fives.Reports/;
}
location /flowrest-demo/ {
proxy_pass http://localhost:8294/flowrest-demo/;
}
access_log logs/8891.tk_access.log;
}
server
{
listen 8898;
server_name 47.99.116.65;
location /qms.welder {
proxy_pass http://localhost:8092/;
}
location /Scripts {
proxy_pass http://localhost:8092/scripts;
}
location /api/ {
proxy_pass http://localhost:8092/api/;
}
location /Welder2/ {
proxy_pass http://localhost:8092/Welder2/;
}
location /5s.api {
proxy_pass http://localhost:8293/5s.api;
}
access_log logs/xxx456.tk_access.log;
}
# 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 localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}