# 指定nginx運行的用戶 和用戶組
#user nobody;
# nginx進程數(shù)(最合適的數(shù)值是cpu的核數(shù),也可以是cpu核數(shù)的2倍)
worker_processes 1;
# 設置錯誤日志文件存放路徑(日志級別 -從低到高:debug | info | notice | warn | error | crit)
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
# 設置存儲nginx進程id的pid文件存放路徑(pid是控制系統(tǒng)中的重要文件)
# pid logs/nginx.pid;
# 工作模式與連接數(shù)上線
events {
# use用來指定nginx的工作模式
# use epoll
#設置單個進程最大連接數(shù)
worker_connections 1024;
}
# http服務器配置部分
http {
# 導入類型配置文件
include mime.types;
# 設定默認文件類型為 二進制流
default_type application/octet-stream;
# 指定日志的輸出格式:
# remote_user:客戶端用戶名;
# status:請求狀態(tài);
# http_referer:父級網(wǎng)頁(從哪個網(wǎng)頁進入這里來的);
# http_x_forwarded_for:客戶端ip地址
#log_format main 'remote_user [request"'
# 'body_bytes_sent "http_user_agent" "http_cookie"';
# 配置nginx日志文件存儲路徑经窖,名稱贺嫂。配置 access_log off則不記錄日志
# access_log logs/access.log main2;
# 開啟高效文件傳輸模式眷唉,sendfile指令 指定nginx是否調(diào)用sendfile函數(shù)來輸出文件,
# 對于普通應用設置為on缰趋,如果用來進行下載等應用磁盤IO重負載應用财忽,可設置為off倘核,
# 以平衡磁盤與網(wǎng)絡I/O處理速度,降低系統(tǒng)的負載即彪。注意?? 如果圖片顯示不正常 把這個改成off
sendfile off;
# 防止網(wǎng)絡阻塞
#tcp_nopush on;
# 設置客戶端連接保持活動的超時時間紧唱。超過這個設定時間后(65秒) 服務器會關掉這個連接
#keepalive_timeout 0;
keepalive_timeout 65;
# gzip模塊設置
# 是否開啟gzip壓縮
gzip on;
# 虛擬主機的配置部分
server {
# 監(jiān)聽端口(此nginx服務占用的端口)
listen 80;
# 域名(可以有多個,空格隔開)
server_name localhost;
# test proxy_pass
location /s {
rewrite .* /bach-erp/prd/views/Product/PriceChange/index@384fcdc4fd90afc5d23e.js;
proxy_pass http://127.0.0.1:88;
}
# bach 工程靜態(tài)資源走 90 端口
location /bach/ {
rewrite ^/(.) http://127.0.0.1:90/1;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#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 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;
# }
#}
include servers/;
}