Completely new to nginx

Brent W

Well-known member
So I have given Centmin a try and have it up and running. I have never used nginx before but I have setup a vhost for my domain and uploaded all the files.

Where do I place the rewrite rules for nginx?

This is the path to my domain

/home/nginx/domains/secfootballforums.com/public
 
So I have given Centmin a try and have it up and running. I have never used nginx before but I have setup a vhost for my domain and uploaded all the files.

Where do I place the rewrite rules for nginx?

This is the path to my domain

/home/nginx/domains/secfootballforums.com/public
Rewrite rules (and all directives) are placed in the vhost definition. I believe (in the Centmin mod) those files are kept under /home/nginx/domains/ and then appropriate name configured.
 
Scratch that... those are for the actual sites themselves.
Look under /usr/local/nginx/conf/conf.d and see if they are there (had to ssh into the centOS box to look).
 
You could also create a htaccess style configuration that looks for a file under each vhost to include with your rewrites, but it's best to put them in the actual virtual host definitions.
 
You could also create a htaccess style configuration that looks for a file under each vhost to include with your rewrites, but it's best to put them in the actual virtual host definitions.
Agreed. For me the simplicity of including it in the file vhost definition itself helps on following the logic without having to go into a second file to look.
 
Agreed. For me the simplicity of including it in the file vhost definition itself helps on following the logic without having to go into a second file to look.

It's also faster. Including rewrites in the vhost is actually the suggested configuration for Apache rather than enabling .htaccess support too. otherwise Apache has to look for a .htaccess file for each request - and it doesn't just look for one, it looks right up through the directory tree to the web root (unless things have changed since I last used Apache).
 
Thanks, got it all figured out. Haven't gotten Zend OpCache working with Php 5.5. for some reason. Doesn't show up in phpinfo but memcache does.
 
Thanks, got it all figured out. Haven't gotten Zend OpCache working with Php 5.5. for some reason. Doesn't show up in phpinfo but memcache does.
I haven't played with PHP 5.5 yet (waiting for it to be "stable" and shipped out as a Debian package). I know that with some of the cache's you have to define a memory footprint for it to use. Is Zend OpCache the same?
 
Yes. You can see what CentminMod looks like with it here: http://cloud2.whippmedia.com/
Have you reviewed http://stackoverflow.com/questions/17224798/how-to-use-php-opcache?

Looks like you have to enable it in php.ini and then set your other parameters (some base ones) - have you checked that?

Code:
zend_extension=/full/path/to/opcache.so
; Sets how much memory to use
opcache.memory_consumption=128

;Sets how much memory should be used by OPcache for storing internal strings
;(e.g. classnames and the files they are contained in)
opcache.interned_strings_buffer=8

; The maximum number of files OPcache will cache
opcache.max_accelerated_files=4000

;How often (in seconds) to check file timestamps for changes to the shared
;memory storage allocation.
opcache.revalidate_freq=60

;If enabled, a fast shutdown sequence is used for the accelerated code
;The fast shutdown sequence doesn't free each allocated block, but lets
;the Zend Engine Memory Manager do the work.
opcache.fast_shutdown=1

;Enables the OPcache for the CLI version of PHP.
opcache.enable_cli=1
 
I have not reviewed it completely yet. I am using the defaul ini that eva2000 of CentminMod attaches. I am still getting my feet wet. I have two sites live on it now though at least.
 
Top Bottom