简体   繁体   中英

NGINX automatically redirects subdomain to domain

So I know this seems like a question many people have asked before but I wasn't able to find an answer yet so I'll ask anyway. I have a few websites set up on one IP address, which means I need to use SNI - one of said subdomains is mail.domain.tld, which works perfectly fine and another is cloud.domain.tld, which unfortunately doesn't.

  1. cloud.domain.tld redirects to www.domain.tld when it is up.
  2. manually typing 'cloud.domain.tld/login' works even when other websites are up but I haven't been able to make the subdomain append /login automatically, which is what I want to do.
  3. when I change the name of cloud.domain.tld to mail.domain.tld, leaving the entire config the same, it works.
  4. when I added clou.domain.tld and clouds.domain.tld to my DNS settings and set the website to those it works too.

So I changed the location / block from rewrite ^ /index.php$uri; - as default in owncloud configuration to return 301 /index.php$uri; and now this problem has been resolved, however logging out now returns a CSRF error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM