Request_uri missing in proxy_pass (nginx proxy) Obsidian Publish configuration documentation

The Obsidian Publish documentation contains here the following instructions for configuring a Nginx server in proxy mode:

location /my-notes {
  proxy_pass https://publish.obsidian.md/serve?url=mysite.com/my-notes/;
  proxy_ssl_server_name on;
  proxy_set_header Host publish.obsidian.md;
}

In my experience, this configuration contains a small error.

The request https://mysite.com/my-notes/ will work, but the other pages https://mysite.com/my-notes/foo/ https://mysite.com/my-notes/bar/ … will return a 404 error.

Question: am I the only one to have noticed this problem?

To fix this problem, I need to add $request_uri:

location /my-notes {
  proxy_pass https://publish.obsidian.md/serve?url=mysite.com/my-notes$request_uri;
  proxy_ssl_server_name on;
  proxy_set_header Host publish.obsidian.md;
}

Question: am I the only person to have noticed this lack in the documentation?

Additional note: my Nginx instance runs in a container (I use the Nginx Docker image) and I need to add resolver 8.8.8.8; to handle the no resolver defined to resolve publish.obsidian.md, client error. I don’t understand why :thinking:.

My complete configuration looks like this:

server {
    listen 80;
    listen [::]:80;

    resolver 8.8.8.8;

    location / {
      proxy_pass https://publish.obsidian.md/serve?url=docs.value-props.com$request_uri;
      proxy_ssl_server_name on;
      proxy_set_header Host publish.obsidian.md;
    }
}

@marcusolsson I see here it was you who published this configuration, what do you think of this proposed correction?

Best regards,
Stéphane


Crossposted on GitHub Issues: Request_uri missing in proxy_pass (nginx proxy) Obsidian Publish configuration documentation · Issue #737 · obsidianmd/obsidian-help · GitHub

I am gonna archive this and keep this specific issue on the GitHub of the docs

1 Like