后台手机端域名可以不填吗?
后台手机端域名可以不填吗?
By wanguk
at 2017-12-28
0人收藏 • 2195人看过
我填了手机端,api的,结果打开都是一个php的源码,已经解析,已经绑定,域名都是绑定到网站根目录的。
<?php
require(__DIR__ . '/common.php');
$HTTPMethod = $_SERVER['REQUEST_METHOD'];
if (!in_array($HTTPMethod, array('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS'))) {
exit('Unsupport HTTP method');
}
if ($Config['WebsitePath']) {
$WebsitePathPosition = strpos($RequestURI, $Config['WebsitePath']);
if ($WebsitePathPosition !== 0) {
exit('WebsitePath Error!');
} else {
$ShortRequestURI = substr($RequestURI, strlen($Config['WebsitePath']));
}
} else {
$ShortRequestURI = $RequestURI;
}这是什么问题?谢谢
- 登录后方可回帖
6 个回复 | 最后更新于 2017-12-29
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.94cb.com 94cb.com m.94cb.com api.94cb.com cdn.94cb.com;
ssl on;
ssl_certificate_key /etc/letsencrypt/live/www.94cb.com/privkey.pem;
ssl_certificate /etc/letsencrypt/live/www.94cb.com/fullchain.pem;
set $redirect_to_https 1;
if ($host = 'cdn.94cb.com') {
set $redirect_to_https 0;
}
if ($scheme = https) {
set $redirect_to_https 0;
}
if ($redirect_to_https = 1) {
rewrite ^(.*) https://$host$1 permanent;
}
root /www/web/carbon/public_html;
index index.html index.php index.htm;
include /www/web/carbon/public_html/nginx.conf;
location ~ \.php(.*)$ {
fastcgi_pass unix:/tmp/php-71-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;
fastcgi_param PATH_INFO $2;
include fcgi.conf;
}
access_log /www/web_logs/94cb.com_access.log wwwlogs;
error_log /www/web_logs/94cb.com_error.log;
}这是我自己的,你参考下。
果然错了,打开api域名出现
{
"Status": 0,
"ErrorCode": 403,
"ErrorMessage": "Forbidden"
}这个就是对了吧。
感谢管理员!
回复#3 @wanguk :
对的。
回复#4 @lincanbin :
感谢!把调用图片解决了就基本可以上线了
回复#5 @wanguk :
