Nginx static files

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;

}

}

On 25 Sep 2013 09:18, “pacolotero pacolotero” [email protected]
wrote:

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

You appear to have forgotten to ask a question!

I mean, I assume you’ve already tried some things out and aren’t just
expecting someone to write the new config for you … :wink:

Jonathan