Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save muhafazakar/134c39b79fc5720eedbd to your computer and use it in GitHub Desktop.

Select an option

Save muhafazakar/134c39b79fc5720eedbd to your computer and use it in GitHub Desktop.
NGINX virtual server example - NGINX virtüel sucunu örnegi
server {
listen 80;
server_name ornek.de www.ornek.de;
access_log /srv/www/logs/ornek.de/access.log;
error_log /srv/www/logs/ornek.de/error.log;
root /usr/local/nginx/html/ornek.de;
location / {
if ($request_method !~ ^(GET|HEAD|POST)$ ){
return 444;
}
index index.php index.html index.htm;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
if ($request_method !~ ^(GET|HEAD|POST)$ )
{
return 444;
}
if (!-f $request_filename) {
return 404;
}
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment