Closed sulisu closed 10 months ago
nginx 反向代理就行
我就是把50000端口反代到a.com/memos
Issue is not in English. It has been translated automatically.
nginx reverse proxy will do
I just reversed port 50000 to a.com/memos
nginx 反向代理就行
我就是把50000端口反代到a.com/memos
nginx和memos都是默认配置,不需要特殊配置吗?
因为我看http往返内容,如果不在反向代理上对response内容替换字符串添加baseurl,返回的进一步访问请求都是域名后面直接跟memos自身路径比如/assets,不带baseurl的。因为我在caddy2上配置了过滤,不是baseurl路径下的访问请求全部401。如果不配置替换,在chrome的开发者工具下,是会看到第一个带baseurl的访问之后,后面的访问请求都没有baseurl,而且全部被caddy2返回401拒绝(是caddy2返回的,不是memos返回的)。
您可以试下,如果在nginx下配置了访问策略,只允许hostname:50000/memos路径访问,对hostname:50000/assets这样的访问全部拒绝,是不是还能正常访问。
Issue is not in English. It has been translated automatically.
nginx reverse proxy will do
I just reversed port 50000 to a.com/memos
Both nginx and memos are configured by default, so no special configuration is required?
Because I look at the http round-trip content, if the baseurl is not added to the response content replacement string on the reverse proxy, the further access requests returned are directly followed by the domain name followed by the path of memos itself, such as /assets, without baseurl. Because I have configured filtering on caddy2, not all access requests under the baseurl path are 401. If you do not configure the replacement, under the developer tools of chrome, you will see that after the first access with baseurl, the subsequent access requests do not have baseurl, and all of them are rejected by caddy2 with 401 response (returned by caddy2, not memos) of).
You can try, if the access policy is configured under nginx, only hostname:50000/memos path access is allowed, and all accesses such as hostname:50000/assets are denied, can it still be accessed normally.
晚上我试试吧,我用的倒是没问题,没用docker,直接是二进制运行
Issue is not in English. It has been translated automatically.
I'll try it tonight, it's okay to use it, I don't use docker, just run the binary directly
Also unable to get memos working in a subdirectory like my-domain.com/memos
. memos.my-domain.com
works just fine for now, but this requires another DNS record pointing memos.my-domain.com
to the IP of my server.
memos.my-domain.com
works just fine for now
I recommend this as standard usage.
Issue is not in English. It has been translated automatically.
@boojack portainer does not have this problem and can work normally in sub-paths. You can refer to their solutions.
Is your feature request related to a problem?
No
Describe the solution you'd like
Please add suppport for base url when possible. So Memos can run from a base url such as:
https://www.acme.com/private/memos/
Additional context
mode: prod version: 0.14.3
Run from windows binary directly.
Now ,I managed to make a partial workaround with Caddy2(replace plugin)
Web client works with some little problem, while 3rd party app can not login.
My reverse proxy config for memos
URL scheme has changed a lot from 0.14.x, following is a working Caddfile config with replace plugin for 0.19.0. And it works with MoeMemos for Android 0.7.3: