How to serve static files using nginx

You can just do like what is did:

CentOS / Fedora

sudo usermod -a -G your_user_name nginx
chmod 710 /home/your_user_name

Ubuntu / Debian

sudo usermod -a -G your_user_name www-data
sudo chown -R :www-data /path/to/your/static_folder

And in your nginx file that serve your site make sure that your location for static is like this:

location /static/ {
root /path/to/your/static_folder;
}

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response