nginx accesses static resources

nginx accesses static resources

Open the nginx configuration file

1 Open the nginx.conf file

insert image description here

2 Modify nginx.conf content

insert image description here

Just modify or add a location, you can access all files under the html path

        location / {
    
    
            alias /www/server/nginx/html/;
            autoindex on;
        }

If you only need to access the content of a specific html folder, you need to specify

        location /static/{
    
    
           alias /www/server/nginx/html/static/
        }

Effect

insert image description here

Guess you like

Origin blog.csdn.net/Linlietao0587/article/details/128711250