gpt4 book ai didi

laravel - 如何设置同一IP地址80端口的域名和子域名?

转载 作者:行者123 更新时间:2023-12-02 13:28:57 26 4
gpt4 key购买 nike

我要设置172.01.03.04 至 example.com和172.01.03.04 到 subdomain.example.com

两个域都应设置为默认端口 80。

Ubuntu_18.04

Nginx

Laravel 5.5

需要帮助高级致谢

最佳答案

example.com

服务器{
听80;
服务器名称 example.com;
根/var/www/html/example.com/public;

    index index.html index.php;

location / {
try_files $uri $uri/ /index.php?$query_string;
}


location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}

location ~ /\.ht {
deny all;
}

location ~ /.well-known {
allow all;
}

}

对于子域名.example.com

服务器{
听80;
服务器名称子域名.example.com;
根/var/www/html/subdomain.example.com/public;

    index index.html index.php;

location / {
try_files $uri $uri/ /index.php?$query_string;
}


location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}

location ~ /\.ht {
deny all;
}

location ~ /.well-known {
allow all;
}

}

关于laravel - 如何设置同一IP地址80端口的域名和子域名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58110933/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com