Nginx配置

   Author: Gentleman.Hu
   Create Time: 2020-11-09 22:53:52
   Modified by: Gentleman.Hu
   Modified time: 2020-11-09 23:27:06
   Email: [email protected]
   Home: https://crushing.xyz
   Description: 一些nginx配置

Index of 目录

  • nginx 开启对某目录的index

location /somedirectory/ {
    autoindex on;
    autoindex_exact_size off;
    autoindex_format html;
    autoindex_localtime on;
}

反代不显示图片等信息

location /
{
    proxy_pass http://127.0.0.1:8083;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;

    add_header X-Cache $upstream_cache_status;

    #Set Nginx Cache

        add_header Cache-Control no-cache;
    expires 12h;
}
location ~ .*.(js|css|png|img|gif|jpg)$ {
proxy_pass http://127.0.0.1:8083;
}

Apache 的多目录分流代理

Last updated