Showing posts with label nginx. Show all posts
Showing posts with label nginx. Show all posts

Sunday, April 19, 2015

Using Nginx on Mac OSX

To install Nginx on your Mac you can use simply brew command:
$ brew install nginx 
Default Nginx server name is localhost with 8080 port. So you can see default Nginx page by entering http://localhost:8080 address. Let's change something:

Changing default server name and port
Nginx.conf located at /usr/local/etc/nginx/nginx.conf dir. Open it with your favorite editor, to me the Vim:
$ vim /usr/local/etc/nginx/nginx.conf
 You'll see default server configuration like this:
server {    listen 8080;    server_name locahost;
    ## other things}
Change them with what you want and save the file. To reload Nginx configuration you should restart Nginx by calling these:
$ sudo nginx -s stop$ sudo nginx 
Including multi server defination from different files
Aww, cool topic. To keep different server definations in different files, you should need to this. Open nginx.conf, locate your cursor to the end of http defination block and simple paste this two lines:
$ include /usr/local/etc/nginx/conf.d/*.conf;
$ include /usr/local/etc/nginx/sites-enabled/*.conf;
Now your can create symlinks to these directories. Of course, don't forget to restart Nginx!

Thursday, July 31, 2014

[DevOps][Nginx] fastcgi_pass Problems

If you are getting error about fastcgi_pass option like this:
2014/07/31 08:08:39 [error] 3536#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 95.95.95.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
or this:
2014/07/31 08:25:07 [crit] 3644#0: *23 connect() to unix:/tmp/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 95.95.95.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "localhost"
You have probably setted wrong or passive TCP or socket address. You can learn PHP's TCP or socket addsress from /etc/php5/fpm/pool.d/www.conf file. Check lines that starts with these:
listen = 127.0.0.1:9000 ;listen = /tmp/php5-fpm.sock
Destroy ; char from starting, and have fun! Don't forget to restart your PHP or your another service -- like this $ service php5-fpm restart!

Monday, July 21, 2014

[Vagrant][Nginx][Laravel] Laravel Kurulum Sorunlari

http://laravel-recipes.com/recipes/26 http://laravel.io/forum/05-14-2014-502-bad-gateway-in-vagrant-permission-denied

Friday, July 18, 2014

[Nginx] Konfigurasyon Dosyalarini Test Etmek

Nginx eger site konfigurasyonlarinizi mazeret gostererek service nginx restart komutlariniza kayitsiz kaliyorsa, asadidaki komut ile Nginx konfigurasyon dosyanizi test edip sorunun kaynagina ulasabilirsiniz.
/usr/nginx/sbin/nginx -t -c /etc/nginx/DOSYA.conf