Questions tagged [static-files]
76 questions
1
vote
1 answer
Nginx location block for static content without listing every extension?
I need to add cache policy to my static content.
Initially, I had manually listed all the extensions I deemed static, which is what almost every answer suggests:
location ~* \.(jpeg|jpg|gif|png|ico|css|bmp|js)$ {
# …
}
I would then run into…

ᴍᴇʜᴏᴠ
- 577
- 1
- 6
- 20
0
votes
1 answer
Any way to reduce redundant location block codes in Nginx config?
Is it possible to DRY a bunch of location blocks in Nginx with the exact same configuration, just different routes? Take a look at the following snippet off my Nginx .conf, for instance:
location / {
proxy_pass http://127.0.0.1:3000;
charset…

TheLearner
- 157
- 1
- 6
0
votes
1 answer
What does rsync status code 3072 mean?
I'm using the static site generator Nanoc, with rsync locally and on the (ancient Ubuntu) server so I can deploy from the command line.
It's been awhile since I last used rsync for this site but I'm now getting:
Nanoc::Extra::Piper::Error: command…

Dave Everitt
- 201
- 1
- 4
- 11
0
votes
1 answer
nginx static files served on server using curl, but not to browser on remote machine
I'm working my way through my first nginx / gunicorn / flask deployment using a stock Amazon Lightsail Ubuntu server. At this point, I'm ignoring gunicorn and flask, and just trying to get nginx to serve my static files.
I am able to get a static…

Larry Lustig
- 113
- 6
0
votes
0 answers
Nginx: disable caching if page contains the word
I am using nginx as a reverse proxy.
Is it possible somehow to access response page content as a variable to disable caching for a pages that have specific word in content (not in header) WITHOUT modifying backend?
Any way would be appreciated…

POMATu
- 210
- 2
- 10
0
votes
1 answer
nginx serving static files doesn't work properly with comma character
Summary: Static files are publishing in /path/to/root , If the request is not in the static folders, the request sending @a1 location block.
Static…

Abdullah Ceylan
- 27
- 5
0
votes
0 answers
Web application serving static files using Docker on multiple hosts
Before Docker we normally had a NFS server on a separate host(s) and then mounted it on nginx and app hosts, so that nginx instances could serve static files created by web app and app worker instances could process user uploads.
Migrating to Docker…

Andrei
- 235
- 3
- 10
0
votes
1 answer
Express.js fails to serve all static files on heroku
there, I have a little problem with node.js and express on heroku. I have a node.js server that loads up my index.html page and other resources:
process.env.PWD = process.cwd();
var express = require("express");
var fs = require("fs-extra");
var app…

TheDude Alex Nuzum
- 1
- 1
- 3
0
votes
2 answers
Why does nginx raise a 404 when it tries to acess static files on a FreeBSD server?
I've got nginx 1.8.1 on a server running FreeBSD 10.2. I'm trying to serve files from a subdirectory of /usr/local/www/ (which is default on FreeBSD), but for some reason, requests to the files I'm trying to access always result in a 404.
The file…

Jules
- 201
- 4
- 11
0
votes
1 answer
Nginx serving index.html fine, but requests for assets are bad
i have the following nginx config:
server {
listen 80;
listen [::]:80;
listen 443;
listen [::]:443;
server_name oreqizer.com;
location / {
root…

Idefixx
- 101
- 1
0
votes
0 answers
Nginx: Serve PHP files from defined location only
I have an AngularJS app in /home/app/front and a PHP backend in /home/app/back. Now I would like to serve static files from / and PHP from /api/v1/
I tried the following config with no success. Nginx throws the following error message: FastCGI sent…

Aley
- 209
- 2
- 4
- 16
0
votes
1 answer
Staticfiles for Django cannot be located on IIS 8
I have a Django 1.7 website configured on IIS 8 platform. The staticfiles are kept in a folder generated after running collectstatic command. As mentioned in the tutorials I have made that folder a virtual directory and deleted the django handler…

Zain Khan
- 111
- 7
0
votes
1 answer
refreshing Expires daily
I'm operating a website on which the (static) content is generated once daily. This allows setting the expires setting to "modification plus 1 day". (I'm running apache with mod_expires.)
Most files on the server aren't regenerated every day. If a…

Kritzefitz
- 113
- 5
0
votes
1 answer
Serve static files from directory depending on http referrer inside of nginx
My server hosts images, but the content of images have to be different for the same link and have to deepens on http referrer.
For example: Website 1 load image website1.jpg from www.example.com/123123/img.jpg
Website 2 load image…

user2721435
- 11
- 2
0
votes
1 answer
How to serve static files for multiple Django projects via nginx to same domain
I am trying to setup my nginx conf so that I can serve the relevant files for my multiple Django projects. Ultimately I want each app to be available at www.example.com/app1, www.example.com/app2 etc. They all serve static files from a…

fanatix
- 3
- 2