Hi there!
I have successfully deployed a doplet using ubuntu + rails + nginx + unicorn. Everything is up and running.
Ideally I would like app.mydomain.com to run my ruby application and mydomain.com to serve static html content. Is that something that’s possible with nginx?
Thanks! Alex
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
That’s definitely possible. You’ll just need to define a new server block in your Nginx configuration, pointing to the directory holding the static files. You also need to set
server_name
for each block so Nginx knows how to direct the requests.Here’s an example:
For more information, check out these tutorials:
@asb thanks!! very useful!!