nginx下配置虚拟主机

linux 虚拟机下配置虚拟主机

nginx.conf 文件不动, 在 conf.d 或者 conf 目录下 新建项目.conf

server {
listen 80;
server_name localhost;
root /var/www/html/device/; #项目的根目录
index index.php index.html index.htm; #默认寻找的文件
# 找不到的文件就转到index.php
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
} location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;#监听9000端口
include fastcgi_params;
# 脚本文件请求的路径
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} location ~ /\.ht {
deny all;
} }

  

上一篇:关于如何在Visual Studio上仿真调试安卓的U3D应用


下一篇:Codeforces Round #244 (Div. 2) C. Checkposts (tarjan 强连通分量)