Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改nginx端口号导致模板的js无法加载 #26

Open
coollce opened this issue Nov 15, 2023 · 1 comment
Open

修改nginx端口号导致模板的js无法加载 #26

coollce opened this issue Nov 15, 2023 · 1 comment

Comments

@coollce
Copy link

coollce commented Nov 15, 2023

添加模板和修改模板,页面会加载下面的js

<script type="text/javascript" src="{$get_curl}:8000/web-apps/apps/api/documents/api.js"></script>

但get_curl()函数会把域名和端口号都返回回来
function get_curl()
{
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
return $http_type.$_SERVER['HTTP_HOST'];
}

导致当我把nginx的80端口修改为 8988的时候,添加模板的那段js就变成了 10.10.7.3:8988:8000/web-apps/...../.js

<script type="text/javascript" src="10.10.7.3::8988:8000/web-apps/apps/api/documents/api.js"></script>
@coollce
Copy link
Author

coollce commented Nov 15, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant