Last active
March 22, 2018 15:56
-
-
Save Anyoks/51419f8f8a81649c9209ed78511b36e4 to your computer and use it in GitHub Desktop.
Deploying two separate rails Apps to subdomain and main domain. These are the nginx conf files found in /etc/nginx/sites-available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config for the domain | |
server { | |
listen 80 default_server; | |
listen [::]:80; | |
server_name miraclemanner.org miraclemanner.org; | |
passenger_enabled on; | |
passenger_app_root /home/deploy/miracle_manner/current; | |
rails_env production; | |
root /home/deploy/miracle_manner/current/public; | |
# Add index.php to the list if you are using PHP | |
index index.html index.htm index.nginx-debian.html; | |
location = /50x.html { | |
root html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config for the subdomain | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name test.web.org www.test.web.org; | |
rails_env production; | |
root /home/deploy/travelWatamu/current/public; | |
index index.html index.htm; | |
location / { | |
passenger_base_uri /; | |
passenger_app_root /home/deploy/travelWatamu/current; | |
#try_files $uri $uri/ =404; | |
passenger_enabled on; | |
passenger_ruby /home/deploy/.rvm/gems/ruby-2.5.0/wrappers/ruby; | |
} | |
#Optional ssl certs | |
listen 443 ssl; # managed by Certbot | |
ssl_certificate /path_to_cert; # managed by Certbot | |
ssl_certificate_key /path_to_cert.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
if ($scheme != "https") { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment