Skip to content

Instantly share code, notes, and snippets.

@rajeshisnepali
Created March 22, 2020 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeshisnepali/9a709d0cccc854cdaeba12ccb98537d2 to your computer and use it in GitHub Desktop.
Save rajeshisnepali/9a709d0cccc854cdaeba12ccb98537d2 to your computer and use it in GitHub Desktop.
Redirect subdomain home page to another url of same subdomain
server {
listen 80;
root /var/www/html/subdomain/web-app/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name app.web-app.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = / {
return 301 http://app.web-app.com/login;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment