nginx 使用

2021/8/2 nginxvue

# 路径

/usr/local/nginx/sbin/
1

# 配置

文件不存在,重定向到首页(针对vue)

try_files $uri $uri/ /index.html;
1

# 支持php

server {
	
    listen       80;
    server_name  netmusic.htwinkle.cn;

    location / {
        root   /root/app_web/netMusic/Meting/src;
        index  index.html index.htm index.php Meting.php;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /www/$fastcgi_script_name;
        include        fastcgi_params;
    }
	
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
最后更新时间: 2024/7/9 15:11:02