我无法弄清楚将大多数流量代理到本地 Solr 安装但将一个路径/目录请求发送到静态 html 目录的基本语法。所有二级、三级等位置是否都需要通过正则表达式设置?还没有找到关于此问题的简单指南。
当前错误:/adv/index.html - 404 - 未找到 /adv/ - 403 禁止 /solr/ - 工作正常
这是我的配置:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
#include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
index index.html;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
location / {
proxy_pass http://localhost:8983;
}
location /adv/ {
# also wasn't sure what permissions needed here
# recursively set adv folder and files within to 777
alias /var/www/adv;
}
}
}