January 13, 2011 11:24PM
Hello,

I thought I've configured Nginx serve static content itself. How do I
know Nginx is serving Static content on itself.

my config

server {

# Replace this port with the right one for your requirements
listen 80; #could also be 1.2.3.4:80

# Multiple hostnames separated by spaces. Replace these as well.
server_name example.com; #Alternately: _

root /var/www/example;

error_page 400 /apache_errors/index400.html;
error_page 401 /apache_errors/index401.html;
error_page 403 /apache_errors/index403.html;
error_page 404 /apache_errors/index404.html;
error_page 500 /apache_errors/index500.html;


client_max_body_size 15M;

access_log /var/log/nginx/example.access.log;
error_log /var/log/nginx/example.error.log error;
index index.html index.php;

# serve static files directly
location ~*
^.+\.(jpg|jpeg|gif|css|png|js|ico|html|mp3|mp4|avi|swf|flv)$ {
access_log off;
expires 30d;
}

location ~ .php$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}


If the configuration is wrong please correct me.

Sincerely
Eberx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Serve static file

Eberx January 13, 2011 11:24PM

Re: Serve static file

Juan Fco. Giordana January 14, 2011 12:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 295
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready