不同的域名可以指向同一个项目
2023-09-27 14:24:29 时间
server{
listen 80;
server_name www.hello.com;
index index.html index.htm index.php admin.php;
root /home/wwwroot/default/dexin/dragon/public;
#error_page 404 /404.html;
#include enable-php.conf;
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
access_log /home/wwwlogs/access.log;
}
server{
listen 80;
server_name www.world.com;
index index.html index.htm index.php admin.php;
root /home/wwwroot/default/dexin/dragon/public;
#error_page 404 /404.html;
#include enable-php.conf;
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
access_log /home/wwwlogs/access.log;
}
实践证明,这两个域名都可以访问同一个资源。
www.hello.com
www.world.com
相关文章
- uni项目踩坑 判断进入的域名链接 动态显示tabbar
- nginx的配置,要求根据不同的来路域名,发送到不同的端口去处理
- VS2013中使用本地IIS+域名调试ASP.NET项目
- spring boot Access-Control-Allow-Origin设置多个域名
- 域名小知识:Public Suffix List
- 域名备案中的坑
- 本地nginx多域名映射
- java获取访问路径、域名、项目名、请求入参
- 如何在自己的网站域名前面加个小图标
- Tomcat部署web项目,如何直接通过域名访问,不加项目名称
- 关于 服务器ip和域名进行一个绑定
- 域名恶意解析的原因是什么
- PHP如何获取当前主机、域名、网址、路径、端口等参数