Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

NGINX Configuration How To Rate Topic   - - - - -

 
  • tigerbabba
  • Member
  • Members
  • Join Date: 26-Apr 08
  • 257 posts

Posted 08 April 2013 - 05:04 PM #1

Those of you who are in need of configuration for NGINX assuming you have everything installed - I am still working on SSL configuration which I will post here shortly in your conf.d directory create a file called http.conf and paste this *** DONT FORGET TO MODIFY THE FILE WITH YOUR DOMAIN AND DIRECTORY

server {
    listen	   80;
    server_name  www.YOURDOMAIN.com YOURDOMAIN.com;
    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;
    location / {
	    root   /var/www/YOURDOMAIN/public_html;
	    index  index.php;
try_files $uri $uri/ /index.php?sef_rewrite=1;
}
    #error_page  404			  /404.html;
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
	    root   /usr/share/nginx/html;
    }
    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
	    root		   /var/www/YOURDOMAIN/public_html;
	    fastcgi_pass   127.0.0.1:9000;
	    fastcgi_index  index.php;
	    fastcgi_param  SCRIPT_FILENAME  /var/www/YOURDOMAIN/public_html$fastcgi_script_name;
	    include	    fastcgi_params;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
    }

location ~* \.(css|js|jpg|jpeg|png|swf|gif|svg|ttf|eot)$ {
			    root /var/www/YOURDOMAIN/public_html;
		 try_files $uri http://backend$1;
		 access_log /var/log/nginx/static.access.log;
			    error_log /var/log/nginx/.static.error.log;
  expires 60d;
  add_header Cache-Control "public";
  add_header Last-Modified "Sat, 30 Mar 2013 21:47:15 GMT";
	    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #

    location ~ /\.ht {
	    deny  all;
    }
}


Currently using CS-Cart 4.x
Fortigate Firewalls

 
  • miracles
  • Senior Member
  • Members
  • Join Date: 19-Sep 07
  • 1533 posts

Posted 09 April 2013 - 05:38 AM #2

Where to config these files ?
CS-CART 3.0.6 GRENADE

Please vote for CDN Add-on

For SEO Article Submission, Forum Profile Links, Web 2.0 links, contact me through PM.

 
  • sertaconay
  • Member
  • Members
  • Join Date: 29-Dec 11
  • 18 posts

Posted 09 April 2013 - 06:18 AM #3

This is a vhost file example.

And Nginx SSL configuration is easy:


server {
      listen 443 ssl;
      ssl_certificate      /path/to/cert.pem;
      ssl_certificate_key  /path/to/cert.key;
}


 
  • gabbo
  • Junior Member
  • Trial users
  • Join Date: 04-May 11
  • 92 posts

Posted 10 April 2013 - 02:55 PM #4

http://backend$1 ?