Setting up Nginx + Passenger » History » Revision 2
Revision 1 (Rytis Sileika, 08/01/2012 10:18 AM) → Revision 2/7 (Kevin Cormier, 01/11/2013 12:10 PM)
h1. Setting up Nginx + Passenger Passenger packages/repos are available at http://passenger.stealthymonkeys.com/ Install packages <pre> # yum install -y nginx-passenger </pre> Create self signed certificate <pre> # cd /etc/nginx/ # openssl genrsa -des3 -out server.key 1024 # openssl req -new -key server.key -out server.csr # cp server.key server.key.org # openssl rsa -in server.key.org -out server.key # openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt </pre> Make a local copy of the apps `public` directory (local to rails, as nginx/passenger doesn't seem to like symbolic links) <pre> # cd /usr/share/foreman # rm public # cp -a /var/lib/foreman/public . </pre> Add to `/etc/nginx/nginx.conf`: <pre> env PATH; </pre> Create foreman application config file `/etc/nginx/conf.d/foreman.conf`: <pre> server { listen 443; server_name _; ssl on; ssl_certificate /etc/nginx/server.crt; ssl_certificate_key /etc/nginx/server.key; access_log /var/log/nginx/foreman_access.log; error_log /var/log/nginx/foreman_error.log debug; root /usr/share/foreman/public; passenger_enabled on; passenger_user foreman; passenger_group foreman; #location / { #} } </pre>