网站安装好了,但是填写备案号之后不能跳转
By
xihuheyi
at 2018-08-11 • 0人收藏 • 2874人看过
17 个回复 | 最后更新于 2018-08-18
2018-08-11
#9
回复#14 @学神之女 :
大佬,phpdish安装到这一步就不会了
生产环境
如果你是 Apache 用户,直接添加一个 vhost 配置即可;
注意web根目录是 phpdish 下的 web 目录
如果你是 Nginx 用户 拷贝本文件夹下的 nginx/phpdish.conf,按照提示修改你的配置 然后复制内容到你的 nginx.conf 文件里的 http 模块内即可。
没有具体的操作那种,摸不着头脑,可以解答下吗
回复#15 @xihuheyi :
我从你给的链接中找到的Nginx配置文件:
server {
# 监听端口
listen 80;
# 域名
server_name www.phpdish.io;
# 访问日志
access_log /path/to/access/log;
# 错误日志
error_log /path/to/errors/log;
index index.html index.htm app.php;
# web根目录
root /path/to/phpdish/web;
location ~ [^/]\.php(/|$) {
# window 用户一般是这个,注意要事先启动 php-cgi
fastcgi_pass 127.0.0.1:9000;
# linux 用户首选这个,注意sock文件位置是否准确
#fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index app.php;
include fastcgi.conf;
}
location / {
index app.php;
try_files $uri @phpdish;
}
# 图片缓存30天
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
if (-f $request_filename) {
expires 30d;
access_log off;
}
try_files $uri @phpdish;
}
# 静态文件缓存七天
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /\.ht {
deny all;
}
location @phpdish {
rewrite ^(.*)$ /app.php/$1 last;
}
}提示非常明显了,按照注释行下的配置修改即可。
如果怕改坏了,可以和nginx.conf做对比进行修改,然后覆盖nginx.conf。
通常不需要太大的修改
参考例子:
server {
#本地测试,81端口,按需进一步修改
# 监听端口
listen 81;
# 域名
server_name 127.0.0.1;
# 访问日志
access_log D:/phpStudy/phpTutorial/Nginx/accessLogs;
# 错误日志
error_log D:/phpStudy/phpTutorial/Nginx/errorLogs;
index index.php index.html index.htm app.php;
# web根目录
root D:/DemoSite/Projects/MlTree-Forum;#以前做过对这个软件的测试,但以下配置和本软件无关。
location ~ [^/]\.php(/|$) {
# window 用户一般是这个,注意要事先启动 php-cgi
fastcgi_pass 127.0.0.1:9000; #不要的话在此行前加入“#”
# linux 用户首选这个,注意sock文件位置是否准确
#fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index app.php;
include fastcgi.conf;
}
location / {
index index.php app.php;
try_files $uri @phpdish;
}
# 图片缓存30天
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
if (-f $request_filename) {
expires 30d;
access_log off;
}
try_files $uri @phpdish;
}
# 静态文件缓存七天
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /\.ht {
deny all;
}
location @phpdish {
rewrite ^(.*)$ /app.php/$1 last;
}
}如果想要更详细的修改,可以参考Nginx配置教程。
登录后方可回帖



粤公网安备 44030602003677号
点击链接后能跳转呀!