Welcome! Log In Create A New Profile

Advanced

Nginx static files

pacolotero pacolotero
September 25, 2013 04:20AM
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/.

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

Nginx static files

pacolotero pacolotero September 25, 2013 04:20AM

Re: Nginx static files

Jonathan Matthews September 25, 2013 08:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
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