Forum: NGINX Nginx static files

95a07d44ec6bcad2aec033f117989685?d=identicon&s=25 pacolotero pacolotero (pacolotero)
on 2013-09-25 10:18
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;
}

}
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2013-09-25 14:35
(Received via mailing list)
On 25 Sep 2013 09:18, "pacolotero pacolotero" <lists@ruby-forum.com>
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 ... ;-)

Jonathan
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.