The APP_BASE_URL is wrong
in your example it should be APP_BASE_URL=http://10.0.0.2:7002
You need to set the headers for the origin check
Redirection everything to /login would not work! You need also to redirect all other paths ...
For example, requests to http://10.0.0.2:7002/images/Logo.png will end in http://10.0.0.2:7002/login/images/Logo.png
Search the forum for working configs, like for example:
Thanks for your help. I tried the profile in your link and fixed it "APP_BASE_URL" is wrong, but the reverse proxy cannot be implemented. The following provides some information. I hope to find the error
Nginx reverse proxy joplin server configuration file
server {
listen 7002;
server_name localhost;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
client_max_body_size 50m;
# Proxy headers
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# Handle / requests and redirect to a specific port on localhost
location / {
proxy_redirect off;
proxy_pass http://10.0.0.2:22300;
}
}
I'm very sorry. I didn't understand your following help information before. I suspect the problem is here. Can you help me guide how to modify the nginx configuration file to solve the problems mentioned below? thank you
Redirection everything to /login would not work! You need also to redirect all other paths ...
For example, requests to http://10.0.0.2:7002/images/Logo.png will end in http://10.0.0.2:7002/login/images/Logo.png
I cannot see what you are trying to achieve here. It's difficult to see why you actually need a reverse proxy.
From looking at the above it seems that you have set up Joplin server and the reverse proxy on the same machine, 10.0.0.2? You are then using the reverse proxy just to accept requests for port 7002 and redirect them to port 22300 on that same machine (10.0.0.2)?
Anyway, from looking at your nginx server block it looks odd that the servername is localhost. If nginx is listening on localhost:7002 this seems to me to mean that the only machine that can use this reverse proxy is the machine running the reverse proxy itself. Try replacing server_name localhost; with server_name 10.0.0.2;.
I am in no way an expert at this. I am just comparing your config files with those on this forum that apparently do work.
Also it doesn't help if you keep editing your earlier posts as subsequent replies can then make no sense...