Nginx 转发配置
主要是 靜態(tài)文件分離了出來?
#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 ? ? ? 80;
? ? ? ? server_name ?localhost;
client_body_timeout 60000;
? ? ? ? client_max_body_size 1024m;
? ? ? ? send_timeout ? ? ? 60000;
? ? ? ? client_header_buffer_size 16k;
? ? ? ? large_client_header_buffers 4 64k;
? ? ? ? proxy_headers_hash_bucket_size 1024;
? ? ? ? proxy_headers_hash_max_size 4096;
? ? ? ? proxy_read_timeout 60000;
? ? ? ? proxy_send_timeout 60000;
? ? ? ? #charset koi8-r;
? ? ? ? #access_log ?logs/host.access.log ?main;
? ? ? # ?location / {
? ? ?# ? ? ? root ? html;
? ? ?# ? ? ? index ?index.html index.htm;
? ? ?# ? }
location /xxx{
? ?proxy_pass http://127.0.0.1:1608/xxxx;
? ?proxy_set_header Host $host;
? ?proxy_set_header X-Real-IP $remote_addr;
? ? ? ? ? ? proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /dddd {
? ?proxy_pass http://127.0.0.1:9302/dddd/;
# proxy_set_header Host $host;
# ? ?proxy_set_header X-Real-IP $remote_addr;
? ? ? ? # ? proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ .*\.(jpg|png|jpeg|bmp|gif|swf|css|js|txt)$
? ? ? ? {
? ? ? ? ? ? access_log off;
? ? ? ? ? # ?expires 30d;
? ? ? ? ? ? root D:/hx/;
if (-f $request_filename) {?
?
expires 30d;?
?
break;?
?
}?
}
? ? ? ?
? ? ? ??
? ? }
}
總結(jié)
以上是生活随笔為你收集整理的Nginx 转发配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Redhat下载地址
- 下一篇: Nginx —— 检查配置文件ngi