产品服务AMH 免费服务器主机面板SSL证书 免费SSL证书申请 担保单 免费安全、零费率交易平台编程助手免费智能写代码、翻译AMYSQL 免费MySQL管理工具

AMH 社区首页

 AMH社区 - 开放自由有价值的社区

[求助帖] 如何把域名绑到子目录

rascal
铁牌会员
20.00 价值分

rascal 发表于 2014-03-08 13:13:55
我是sd.xxx.com 需要绑定到 ..sd/web/wx/public_html这个目录
conf文件应该怎么写?

我现在的文件内容是

server
{
listen 80;
server_name sd.xxx.com; #server_name end
index index.html index.htm index.php; #index end

set $subdomain '';
root /home/wwwroot/sd/web/wx/public_html$subdomain;
include rewrite/amh.conf; #rewrite end

#error_page
error_page 400 /ErrorPages/400.html;
error_page 403 /ErrorPages/403.html;
error_page 404 /ErrorPages/404.html;
error_page 502 /ErrorPages/502.html;
location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$
{
root /home/wwwroot/sd/web/wx/public_html;
}


location ~ .*\.php$
{
fastcgi_pass unix:/tmp/php-cgi-sd.sock;
fastcgi_index index.php;
include fcgi-host.conf;
fastcgi_param DOCUMENT_ROOT /web$subdomain;
fastcgi_param SCRIPT_FILENAME /web$subdomain$fastcgi_script_name;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$
{
expires 30d;
}

location ~ .*\.(js|css)$
{
expires 12h;
}

access_log off; #access_log end
error_log /dev/null; #error_log end
}



问题是我访问域名是是404错误.
评价: 这个问题有价值吗?  没有 (0分)   有, 感谢 (0分)
2014-03-08 13:13:55 1

ali
银牌会员
3123.65 价值分

location ~ .*\.php$
{
fastcgi_pass unix:/tmp/php-cgi-sd.sock;
fastcgi_index index.php;
include fcgi-host.conf;
fastcgi_param DOCUMENT_ROOT /web$subdomain;
fastcgi_param SCRIPT_FILENAME /web$subdomain$fastcgi_script_name;
}
评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2014-03-08 14:47:59 2

rascal
铁牌会员
20.00 价值分

本帖最后由 rascal 于 2014-3-8 15:24 编辑

现在访问正常了,但是访问php文件是 404错误。
评价: 这个答复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2014-03-08 14:54:35 3
 1  (总1页)
AMH社区列表
用户服务中心