Skip to content

Instantly share code, notes, and snippets.

@huberflores
Last active December 13, 2015 17:59
Show Gist options
  • Save huberflores/4952216 to your computer and use it in GitHub Desktop.
Save huberflores/4952216 to your computer and use it in GitHub Desktop.
Ngnix configuration
/*
* author Huber Flores
*/
### Ngnix configuration - Debian/Ubuntu 32 bits
# Notes:
# Ngnix cannot be used at the same time as Apache Web Server at port 80
### Configuration
# Nginx is installed (by default) in /etc/nginx/
# The configuration file nginx.conf is located at /etc/nginx/
# Nginx can be started/stoped/etc by running these commands:
$ sudo /etc/init.d/nginx start
# nginx -s [ stop | quit | reopen | reload ]
$ sudo /etc/init.d/nginx start
# Ngnix.conf (Main parts to configure)
upstream 127.0.0.1 {
server ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com:8080;
}
server {
server_name ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com;
listen 80;
location / {
proxy_read_timeout 8;
proxy_connect_timeout 8;
proxy_send_timeout 8;
proxy_next_upstream off;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
#proxy_ignore_client_abort off;
#proxy_buffering off;
proxy_pass http://127.0.0.1;
#forward squid cache information
fastcgi_pass_header location;
}
# After configuring the file as described above.
# Start Ngnix
$ /etc/init.d/nginx start
# Stop Apache Web Server
/etc/init.d/apache2 stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment