Install and Configure Nginx
ubuntu@ip-172-31-15-122:~$ cd
ubuntu@ip-172-31-15-122:~$ sudo apt-get install nginx
ubuntu@ip-172-31-15-122:~$ sudo service nginx restart
* Restarting nginx nginx [ OK ]
ubuntu@ip-172-31-15-122:~$
http://23.254.124.45/
** Nginx Welcome Page open **
buntu@ip-172-31-15-122:~$ sudo vi /etc/nginx/sites-available/default
upstream app {
# Path to Puma SOCK file, as defined previously
server unix:/home/ubuntu/sample2prod/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/ubuntu/sample2prod/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_pass http://app;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
ubuntu@ip-172-31-15-122:~$ sudo start puma app=/home/ubuntu/sample2prod
ubuntu@ip-172-31-15-122:~$ sudo stop puma app=/home/ubuntu/sample2prod
ubuntu@ip-172-31-15-122:~$ sudo service nginx restart
No comments:
Post a Comment