How can I configure the Nginx Virtual Host to serve www.mydomain.com/status (a WordPress page) when a visitor visits status.mydomain.com? Note: I do not want a rewrite (I want the visitor to see the subdomain url). Also, I would like to rewrite visits to the page (mydomain.com/status) to status.mydomain.com . I have searched for a long time trying to solve this, but have had no luck. Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
To setup a domain or subdomain you do it the same way, here’s an example of a nginx block to serve a Wordpress site: <br> <br>http://wiki.nginx.org/Wordpress <br> <br>Just replace the server_name directive with your subdomain. <br> <br>For the redirection, in your main domain’s block add something like: <br> <br> <br>location /status { <br> return 301 $scheme://subdomain.domain.com$request_uri; <br>} <br> <br> <br>Contact me if you need any more help ;D <br> <br>http://johnqunknown.me/about/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.