Linux \windows的Nginx静态代理配置文件
2017-07-06 15:58
435 查看
Linux:
upstream app.time-weekly.com {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name app.time-weekly.com;
index index.html index.htm;
charset utf-8;
# ignore favicon.ico not exist.
location = /favicon.ico {
log_not_found off;
access_log off;
}
# not allow to visit hidden files.
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location /blobs/ {
alias /home/data/blobs/;
expires 7d;
}
location /images/ {
alias /home/data/images/;
expires 7d;
}
location /audios/ {
alias /home/data/audios/;
expires 7d;
}
location /videos/ {
alias /home/data/video/;
expires 7d;
}
location / {
if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$) {
add_header Content-Disposition: 'attachment;';
add_header Content-Type: 'APPLICATION/OCTET-STREAM';
}
proxy_pass http://app.time-weekly.com; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REQUEST_HOST $host;
charset UTF-8;
}
}
windows:
upstream static.vlms.cn {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name static.vlms.cn;
index index.html index.htm;
charset utf-8;
# ignore favicon.ico not exist.
location = /favicon.ico {
log_not_found off;
access_log off;
}
# not allow to visit hidden files.
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location /blobs/ {
alias "D:/home/data/blobs/";
expires 7d;
}
location /images/ {
alias "D:/home/data/images/";
expires 7d;
}
location /audios/ {
alias "D:/home/data/audios/";
expires 7d;
}
location /videos/ {
alias "D:/home/data/video/";
expires 7d;
}
location / {
if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$) {
add_header Content-Disposition: 'attachment;';
add_header Content-Type: 'APPLICATION/OCTET-STREAM';
}
proxy_pass http://static.vlms.cn; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REQUEST_HOST $host;
charset UTF-8;
}
}
upstream app.time-weekly.com {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name app.time-weekly.com;
index index.html index.htm;
charset utf-8;
# ignore favicon.ico not exist.
location = /favicon.ico {
log_not_found off;
access_log off;
}
# not allow to visit hidden files.
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location /blobs/ {
alias /home/data/blobs/;
expires 7d;
}
location /images/ {
alias /home/data/images/;
expires 7d;
}
location /audios/ {
alias /home/data/audios/;
expires 7d;
}
location /videos/ {
alias /home/data/video/;
expires 7d;
}
location / {
if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$) {
add_header Content-Disposition: 'attachment;';
add_header Content-Type: 'APPLICATION/OCTET-STREAM';
}
proxy_pass http://app.time-weekly.com; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REQUEST_HOST $host;
charset UTF-8;
}
}
windows:
upstream static.vlms.cn {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name static.vlms.cn;
index index.html index.htm;
charset utf-8;
# ignore favicon.ico not exist.
location = /favicon.ico {
log_not_found off;
access_log off;
}
# not allow to visit hidden files.
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location /blobs/ {
alias "D:/home/data/blobs/";
expires 7d;
}
location /images/ {
alias "D:/home/data/images/";
expires 7d;
}
location /audios/ {
alias "D:/home/data/audios/";
expires 7d;
}
location /videos/ {
alias "D:/home/data/video/";
expires 7d;
}
location / {
if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$) {
add_header Content-Disposition: 'attachment;';
add_header Content-Type: 'APPLICATION/OCTET-STREAM';
}
proxy_pass http://static.vlms.cn; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REQUEST_HOST $host;
charset UTF-8;
}
}
相关文章推荐
- nginx代理 .静态文件不记录日志和配置缓存
- nginx配置1:借助Nginx搭建反向代理服务器与缓存静态文件
- nginx配置1:借助Nginx搭建反向代理服务器与缓存静态文件
- NGINX_CONCAT_MODULE 安装和配置(静态文件打包下载)
- Windows下配置Nginx代理Django
- nginx日志切割,日志格式,静态文件不记录日志,配置缓存
- nginx负载 发向代理配置文件参考
- 2.1-nginx配置静态文件过期时间
- nginx反向代理配置文件详解
- Windows下用Nginx代理Django安装配置实例
- nginx配置静态文件目录,压缩传输
- 最简单的配置nginx.conf使之成为静态文件下载服务器
- LNMP - nginx配置静态文件过期时间
- nginx静态文件配置
- Nginx代理文件配置
- nginx win32 版本静态文件测试 (Windows环境)
- nginx配置静态文件expires时间 cache-control
- nginx 代理配置文件实例
- nginx 代理配置文件实例
- nginx 集群配置方式 静态文件处理