Comments (5)
请参考帮助文档的配置进行反向代理,若还有疑问,请贴出反向代理的配置内容,谢谢。
from onenav.
请参考帮助文档的配置进行反向代理,若还有疑问,请贴出反向代理的配置内容,谢谢。
就是参考帮助文档配置的,我还怀疑是不是因为https重定向到http导致的
from onenav.
请直接提供您的Nginx的配置文件部分,不然不好判断问题。
from onenav.
大概知道原因了,还是nginx配置;
需求背景是:访问a服务器部署的A域名,想默认转到b服务器的oneav服务B域名 ;
服务器a上用nginx配置:
`server
{
listen 80;
listen 443 ssl http2;
server_name a.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/a.com;
charset utf-8,gbk;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
ssl_certificate /www/fullchain.pem;
ssl_certificate_key /www/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EExxxxxraft:EECDxxxxx+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497 https://$host$request_uri;
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
# #error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置,可以注释或修改
include enable-php-00.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/a.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
proxy_pass https://127.0.0.1:23901;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
proxy_pass https://127.0.0.1:23901;
}
#想默认转到b域名的oneav服务
location / {
proxy_connect_timeout 10;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
#proxy_pass http://b.com:8888/;
return 301 http://b.com:8888$request_uri;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#try_files $uri $uri/ @router;
}
#本机其他服务,端口23901
location /mmm/ {
proxy_pass https://127.0.0.1:23901;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 300s;
}
access_log /www/wwwlogs/a.log;
error_log /www/wwwlogs/a.log;
}
`
部分原因:
重点就是默认的 location / {}下配置,用proxy_pass方式,全部的布局文件啥的,如css,js等其实是404的(浏览器F12看了下),改了几次都不清楚咋代理过来,后面临时用 return 301的方式直接指过去就没这个问题了。
如下:
#proxy_pass http://b.com:8888/; ----ccs,js 直接404
return 301 http://b.com:8888$request_uri; ---直接301重定向可以访问通
from onenav.
你多个服务弄到一个nginx server下,维护和可读性比较差,而且容易冲突。我看你用的二级目录来反代OneNav,猜测是反代后静态资源依然是从顶级目录开始,然后css/js
你又是反代的其它服务,导致静态资源404,你说的301
或者用subs_filter
替换应该都可以解决。
from onenav.
Related Issues (20)
- 请教一下,如何在replit上部署这个onenav呢 HOT 1
- 拖拽排序和多用户登录自定义首页希望尽快实现
- 浏览器扩展程序的建议 HOT 1
- 自动获取的图标都无法正常显示 HOT 1
- 你好,是否可以增加一个设置链接的图标大小功能 HOT 1
- 为什么这么卡? HOT 9
- 希望可以增加修改链接标题颜色的功能
- 希望作者能适配vercel部署或者netlify的部署方式
- [bug]数据库无写入权限时报错异常 HOT 1
- I can not "Initialize OneNav username/password" HOT 1
- a security risk
- 安全漏洞-任意文件删除(Deletion of any document) HOT 1
- 安全漏洞远程代码执行(security breach remote code execution) HOT 2
- 副标题不填时,网站名字拼接很奇怪 HOT 1
- 上传图标功能不好使 HOT 1
- 希望拓展插件能支持火狐浏览器 HOT 2
- sou主题不能使用上传图标 HOT 3
- 建议添加链接的时候可以根据url自动获取网站标题title,可以在不填写标题的情况下进行自动填充
- class/Api.php 存在SQL注入漏洞(SQL injection)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onenav.