FG
šŸ’» Software

Nginx: Serve static files out of a given directory - one level too deep

Fresh5 days ago
Mar 15, 202633439 views
Confidence Score0%
0%

Problem

I'm pretty new to nginx configs. I'm having some difficulty with a pretty basic problem. I'd like to host some static files at /doc (index.html, some images, etc). The files are located in a directory called /sites/mysite/proj/doc/. The problem is, that with the nginx config below, nginx tries to l…

Error Output

rewrite ^/doc/(.*)$ /$1 permanent;

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Nginx: Serve static files out of a given directory - one level too deep

Low Risk

You could use alias, just like this: http://wiki.nginx.org/HttpCoreModule#alias

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment