标签:目录 反向代理 dal ram logs 127.0.0.1 stc mono and
打开目录 /etc/nginx/nginx.conf
1.重定向
server { server_name localhost listen 80; location / { rewrite ^(.*)$ https://fengnovo.github.io/ last; } }
2.反向代理
server { server_name localhost listen 80; location / { proxy_pass http://127.0.0.1:8000; } }
3.设置root目录
server { server_name localhost listen 80; root /var/www/html; index index.php index.html index.htm; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
root /var/www/html; apache默认的根目录在/var/www/html下
即只要在/var/www/html目录下新建php目录并新建index.php,就可以在xxx.xxx.xxx.xxx/php访问到php目录下的index.php
Reference:
https://www.cnblogs.com/zqunor/p/8524646.html
标签:目录 反向代理 dal ram logs 127.0.0.1 stc mono and
原文地址:https://www.cnblogs.com/fengnovo/p/9740874.html