By csbukhari93
Hi,
this my first time setup ghost blog so i try to put it in subdomain but i don’t know how, i use nginx and ubuntu 12.0.4 LTS …
i need it to work in subdomain so i can put another thing in main…
also i have another issue when i type my domain without www it’s not work !! you can check http://csbukhari.com/ http://www.csbukhari.com/
help me please
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!
What is this block of code actually doing? <br> <br>location / { <br>expires 8d; <br>proxy_set_header X-Real-IP $remote_addr; <br>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; <br>proxy_set_header X-Forwarded-Proto $scheme; <br>proxy_set_header Host $http_host; <br>proxy_set_header X-NginX-Proxy true; <br>proxy_read_timeout 5m; <br>proxy_connect_timeout 5m; <br>proxy_pass http://127.0.0.1:1337; <br>proxy_redirect off; <br>proxy_set_header Upgrade $http_upgrade; <br>proxy_set_header Connection “upgrade”; <br>} <br> <br>Is this in the default.conf file? Or is this the customized config file in the sites-available directory?
@wjhsie: <pre>proxy_set_header X-Real-IP $remote_addr; <br>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; <br>proxy_set_header X-Forwarded-Proto $scheme; <br>proxy_set_header Host $http_host; <br>proxy_set_header X-NginX-Proxy true; <br>[…] <br>proxy_set_header Upgrade $http_upgrade; <br>proxy_set_header Connection “upgrade”; </pre>sets the headers nginx should add while proxying the contents to Ghost/nodejs<pre>proxy_read_timeout 5m; <br>proxy_connect_timeout 5m; </pre>sets a couple of connection parameters.<pre>proxy_pass http://127.0.0.1:1337; </pre>sets the server nginx should proxy to (in this case it’s a nodejs app that is listening on port 1337 on the loopback interface). <br> <br>As for the proxy_redirect line, see <a href=“http://wiki.nginx.org/HttpProxyModule#proxy_redirect”>http://wiki.nginx.org/HttpProxyModule#proxy_redirect</a>. <br> <br>I hope that helps.
You need to make sure your DNS points www either to an A record or a CNAME record. <br> <br>As for the subdomain you can do <br> <br>server { <br> listen 80; <br> server_name subdomain.domain.tld <br> <br> location / { <br> expires 8d; <br> proxy_set_header X-Real-IP $remote_addr; <br> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; <br> proxy_set_header X-Forwarded-Proto $scheme; <br> proxy_set_header Host $http_host; <br> proxy_set_header X-NginX-Proxy true; <br> proxy_read_timeout 5m; <br> proxy_connect_timeout 5m; <br> proxy_pass http://127.0.0.1:1337; <br> proxy_redirect off; <br> proxy_set_header Upgrade $http_upgrade; <br> proxy_set_header Connection “upgrade”; <br> } <br>} <br> <br> <br>This is just an example, but change the server name and the proxy_pass and it should work fine <br>
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.