Nginx static files

pacolotero pacolotero lists at ruby-forum.com
Wed Sep 25 08:18:15 UTC 2013


I have a rails server and I would like to serve all this static files *.
jpg, *. png, *. css, *. js, *. gif, *. jpeg with nginx

This is my actual configuration

server {
listen 443;
server_name emotionalworld.co www.emotionalworld.co;
rewrite ^ http://$server_name$request_uri? permanent; # enforce https
}

server {
listen 80;
server_name emotionalworld.co www.emotionalworld.co;

access_log /var/log/nginx/chili-proxy-access;
error_log /var/log/nginx/chili-proxy-error;

expires epoch;

include includes/proxy.include;
proxy_redirect off;

root /home/jaranda/jaranda-emotionalworld;

# Send sensitive stuff via https
# rewrite ^/login(.*) https://your.domain.here$request_uri permanent;
# rewrite ^/my/account(.*) https://your.domain.here$request_uri
permanent;
# rewrite ^/my/password(.*) https://your.domain.here$request_uri
permanent;
# rewrite ^/admin(.*) https://your.domain.here$request_uri permanent;

location / {
# auth_basic "Acceso de solo invitados";
# auth_basic_user_file /etc/nginx/htpasswd;
try_files $uri/index.html $uri.html $uri @fallback;
}

location @fallback {
proxy_pass http://127.0.0.1:9000;
# proxy_set_header X-Forwarded-Protocol https;
# proxy_connect_timeout 15;
# proxy_redirect off;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto https;
}

}

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list