How to transform this nginx conf to Caddyfile
server {
...
location = / {
proxy_pass http://127.0.0.1:1041;
}
location / {
root /public;
}
...
}
How to transform this nginx conf to Caddyfile
server {
...
location = / {
proxy_pass http://127.0.0.1:1041;
}
location / {
root /public;
}
...
}
proxy
doesn’t let you specify exact paths, only base paths, but there’s a few workarounds you could use. I can think of a few ways you could try to use rewrite
logic to get what you want.
One option would be to:
rewrite
requests equal to /
to another location such as /proxy
proxy
from /proxy
to your backend, and include a without /proxy
subdirective to strip the extra basepath you’ve just rewritten toAnother way:
rewrite
requests NOT equal to /
to another locationproxy
everything from /
to your backendThank you.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.