Last active
May 31, 2018 16:45
-
-
Save 1v/7473b4acbaac0d79877d to your computer and use it in GitHub Desktop.
Revisions
-
1v revised this gist
Jul 11, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -59,4 +59,5 @@ Than run app just with upstream. [See](https://gist.github.com/1v/77595e676132a6 * [`Ruby on Rails installation on Ubuntu 12.04 LTS + Nginx + Puma`](https://gist.github.com/1v/10272479) * [`Ruby on Rails "Hellow World" app`](https://gist.github.com/1v/a38f247c41ca60f6e48a) * [`Making production on port 80 and development on any other`](https://gist.github.com/1v/77595e676132a660843c) * [`Nginx behind Apache`](https://gist.github.com/1v/7473b4acbaac0d79877d) * [`God and Puma configuration`](https://gist.github.com/1v/04901ed17202cddfe42d) -
1v revised this gist
Jul 11, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,9 @@ # Nginx **behind** Apache [Install](http://askubuntu.com/a/58185/160368) mod_proxy_http: ``` a2enmod proxy_http ``` Add to `/etc/apache2/apache2.conf` (change ip): ``` <VirtualHost 11.1.11.111:80 > -
1v revised this gist
Jul 11, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ server { listen *:8080; server_name site.com; ``` In `/etc/nginx/conf.d/default.conf` [change port](http://stackoverflow.com/a/12800469/712308) from 80 to something else: ``` server { listen 3000; -
1v revised this gist
Jul 11, 2014 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -40,6 +40,11 @@ server { listen *:8080; server_name site.com; ``` In `/etc/nginx/conf.d/default.conf` change port from 80 to something else: ``` server { listen 3000; ``` Restart nginx: ``` sudo service nginx restart -
1v revised this gist
Jul 11, 2014 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -44,4 +44,10 @@ Restart nginx: ``` sudo service nginx restart ``` Than run app just with upstream. [See](https://gist.github.com/1v/77595e676132a660843c). ## See also * [`Ruby on Rails installation on Ubuntu 12.04 LTS + Nginx + Puma`](https://gist.github.com/1v/10272479) * [`Ruby on Rails "Hellow World" app`](https://gist.github.com/1v/a38f247c41ca60f6e48a) * [`Making production on port 80 and development on any other`](https://gist.github.com/1v/77595e676132a660843c) * [`Nginx behind Apache`](https://gist.github.com/1v/7473b4acbaac0d79877d) -
1v revised this gist
Jul 11, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,11 @@ Add to `/etc/apache2/apache2.conf` (change ip): ``` <VirtualHost 11.1.11.111:80 > ServerName site.com ServerAlias *.site.com CustomLog /var/www/httpd-logs/site.com.access.log combined ErrorLog /var/www/httpd-logs/site.com.error.log ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ServerAdmin webmaster@site.com SuexecUserGroup user user </VirtualHost> -
1v revised this gist
Jul 11, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Nginx **behind** Apache Add to `/etc/apache2/apache2.conf` (change ip): ``` <VirtualHost 11.1.11.111:80 > ServerName site.com -
1v created this gist
Jul 11, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ # Nginx **behind** Apache Add to `/etc/apache2/apache2.conf`: ``` <VirtualHost 11.1.11.111:80 > ServerName site.com ServerAlias *.site.com CustomLog /var/www/httpd-logs/site.com.access.log combined ErrorLog /var/www/httpd-logs/site.com.error.log ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ServerAdmin webmaster@site.com SuexecUserGroup user user </VirtualHost> ``` [Add to](http://stackoverflow.com/a/719845/712308) `/etc/apache2/mods-available/proxy.conf`: ``` <IfModule mod_proxy.c> ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> </IfModule> ``` Restart apache: ``` sudo service apache2 restart ``` In nginx site config specify port and upsteam: ``` upstream ContactAppProduction { server unix:///tmp/MyAppProduction.sock; } server { listen *:8080; server_name site.com; ``` Restart nginx: ``` sudo service nginx restart ``` Than run app just with upstream. [See](https://gist.github.com/1v/77595e676132a660843c).