Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stephane-klein opened this issue May 7, 2024 · 0 comments

Comments

@stephane-klein
Copy link

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 🤔.

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 Obsidian Forum: https://forum.obsidian.md/t/request-uri-missing-in-proxy-pass-nginx-proxy-obsidian-publish-configuration-documentation/81469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant