Jump to content

IPS4 - Nginx config

Mihoko Okayami

Recommended Posts


(Sorry for my english)

With Nginx, when a user does not have access to a forum, it is a Nginx error that appears and not an IPS error.

When there are too many options on a URL, I get an error nginx.

My setup:

server {
	server_name my-domaine.eu *.my-domaine.eu;
	return 301 http://www.my-domaine.eu$request_uri;
	access_log off;
	error_log off;
server {
	server_name www.my-domaine.eu;
	root /home/bestiaire/htdocs/www;
	access_log off;
	error_log /home/bestiaire/logs/www.my-domaine.eu_error.log;
	rewrite /adminarea$ $scheme://$host$uri/ permanent;
	location / {
		try_files $uri $uri/ /index.php$is_args$args;
	location ~^/adminarea/(.*)$ {
		include /etc/nginx/default.d/php/php-fpm.conf;
		allow 1234:1234:1234:1234::/64;
		deny all;
	location ~^(/uploads/).*(.php)$ {
		deny all;
	location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|htm|txt|swf|cur)$ {
		access_log off;
		expires 1w;
	location ~* conf_global.php { return 404; }
	include /etc/nginx/default.d/php/php-fpm.conf;
	include /etc/nginx/default.d/*.conf;


location ~* \.php$ {
	try_files $uri =404;
	fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
	fastcgi_index index.php;
	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	include fastcgi_params;
	fastcgi_param QUERY_STRING $query_string;
	fastcgi_param REQUEST_METHOD $request_method;
	fastcgi_param CONTENT_TYPE $content_type;
	fastcgi_param CONTENT_LENGTH $content_length;
	fastcgi_intercept_errors on;
	fastcgi_ignore_client_abort off;
	fastcgi_connect_timeout 60;
	fastcgi_send_timeout 180;
	fastcgi_read_timeout 180;
	fastcgi_buffers 4 256k;
	fastcgi_buffer_size 128k;
	fastcgi_busy_buffers_size 256k;
	fastcgi_temp_file_write_size 256k;


user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
	worker_connections 1024;
	use epoll;
	multi_accept on;
http {
	include /etc/nginx/mime.types;
	index index.html index.php;
	default_type application/octet-stream;
	real_ip_header X-Forwarded-For; 
	log_format main '$remote_addr - $remote_user [$time_local] "$request" '
					'$status $body_bytes_sent "$http_referer" '
					'"$http_user_agent" "$http_x_forwarded_for"';
	charset utf-8;
	server_tokens off;
	sendfile on;
	tcp_nodelay on;
	keepalive_timeout 65;
	client_body_timeout 30;
	client_header_timeout 30;
	send_timeout 30;
	client_max_body_size 8M;
	reset_timedout_connection on;
	geoip_country /usr/share/GeoIP/GeoLiteCountry.dat;
	geoip_city /usr/share/GeoIP/GeoLiteCity.dat;
	gzip on;
	gzip_disable "MSIE [1-6].(?!.*SV1)";
	gzip_vary on;
	gzip_comp_level 6;
	gzip_proxied any;
	gzip_buffers 16 8k;
	include /etc/nginx/conf.d/*.conf;

Port 8080 because I have a Varnish before, it is just proxies, not configured.

Do you have any suggestions for improvement?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...