IvanShatsky

nginx.conf (rewrite subdomain)

Sep 8th, 2021
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name .domainname.com;
  4.  
  5. if ($http_host = 'admin.domainname.com') {
  6. rewrite ^(?!/wp-admin)(.*)$ https://www.domainname.com$1 permanent;
  7. }
  8.  
  9. location / {
  10. echo "URL is $scheme://$http_host$uri\n";
  11. }
  12.  
  13. error_page 500 502 503 504 /50x.html;
  14. location = /50x.html {
  15. root html;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment