static-files

Rails 3.1, Unicorn and Apache: static files

余生颓废 提交于 2019-12-21 01:49:10
问题 I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and production.rb looks like this. I like using h264 streaming but since Rails is serving these video files, the Apache Mod won't work. DocumentRoot /blabla/current/public RewriteEngine On Options FollowSymLinks <Proxy balancer://unicornservers> BalancerMember http://127.0.0.1:4000 </Proxy> # Redirect all non-static requests to rails RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer:/

Tomcat can't see newly created static files and is server-side caching the old files

£可爱£侵袭症+ 提交于 2019-12-18 06:57:26
问题 I use Tomcat 7 on Windows XP. I have a directory with static files (HTML, CSS, JS) in %TOMCATDIR%/webapps/myapplication . They're accessible via localhost:8080/myapplication When a change happens to a file in my server dir, it is not reflected: modified files are returned (200 OK) the same as previously (tested with Fiddler; for sure not a browser cache issue - cleared cache, using different browsers etc.) , newly created files in that directory are not accessible (404). The above happens no

How to intercept 404 using Owin middleware

十年热恋 提交于 2019-12-18 05:44:32
问题 Background First let me explain the background. I am working on a project that attempts to marry a backend server that uses Web API configured via OWIN- hosted on IIS now, but potentially other OWIN-supported hosts in the future- to a frontend using AngularJS. The AngularJS frontend is entirely static content. I completely avoid server-side technologies such as MVC/Razor, WebForms, Bundles, anything that has to do with the frontend and the assets it uses, and defer instead to the latest and

Node JS not serving the static image

白昼怎懂夜的黑 提交于 2019-12-17 14:56:18
问题 I have already added the codes for serving an image on my node server but it seems to not serve images in the HTML when connecting to Node. I have also external CSS and JS that are being served correctly. Here is the fragment of my code in Node (See below). Thank you in advance! var server = http.createServer(function(req, res) { var pathname = url.parse(req.url).pathname; var ext = path.extname(pathname); var handler = handlers[req.url]; if(ext) { if(ext === ".css"){ res.writeHead(200, {

What's the point of Django's collectstatic?

独自空忆成欢 提交于 2019-12-17 10:18:32
问题 This is probably a stupid question, but it's just not clicking in my head. In Django, the convention is to put all of your static files (i.e css, js) specific to your app into a folder called static . So the structure would look like this: mysite/ manage.py mysite/ --> (settings.py, etc) myapp/ --> (models.py, views.py, etc) static/ In mysite/settings.py I have: STATIC_ROOT = 'staticfiles' So when I run the command: python manage.py collectstatic It creates a folder called staticfiles at the

How to serve all existing static files directly with NGINX, but proxy the rest to a backend server.

孤人 提交于 2019-12-17 05:22:39
问题 location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; if (-f $request_filename) { access_log off; expires 30d; break; } if (!-f $request_filename) { proxy_pass http://127.0.0.1:8080; # backend server listening break; } } Above will serve all existing files directly using Nginx (e.g. Nginx just displays PHP source code), otherwise forward a request to Apache. I need to exclude *.php files from the rule so

How can I return static files in PHP?

亡梦爱人 提交于 2019-12-14 03:53:33
问题 I use a .htaccess file to redirect all requests to the same index.php . From there, I decide what to do depending on URL of the incoming request. For now, I map the request URL to directory structure relative to a source folder, so that example.com/user/create maps to source/user/create/index.php . The file located there can handle the request as needed, and generate HTML output. But that doesn't work for static assets, the browser may request. So my idea is to find out whether a request URL

Deploying Django to AWS; static files for dummies

独自空忆成欢 提交于 2019-12-13 06:39:04
问题 I am utterly lost on one of the last steps of this project. So far, I've been able to develop a django app that works the way I want it to on localhost; I've been able to deploy the website to AWS EC2, but I must be missing something fundamental about serving the static files. (I haven't even tried media files yet.) I've read the Django Deployment page and How-To manage static files, but I have never deployed a website from scratch before. The tutorials I've found seem to be contradicting (or

Django 1.4 static files problems and don't render at other urls of my project

拜拜、爱过 提交于 2019-12-12 14:33:36
问题 Here are my settings: STATIC_ROOT = "/home/tony/Documents/mysite/mysite/" STATIC_URL = '/static/' STATICFILES_DIRS = ( "/home/tony/Documents/mysite/mysite/static/", ) And here I refer my stylesheet(This gives me an error): <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/css/reset.css" /> <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/css/style.css" /> And the error in the log: [06/Apr/2012 13:36:09] "GET /css/reset.css HTTP/1.1" 404 2193 [06/Apr/2012 13:36:09]

Node.js + Express.js on Windows: Static files pending for up to two minutes?

时间秒杀一切 提交于 2019-12-12 12:21:14
问题 I'm having an issue on my Windows environment with Node.Js/Express.js whereby static JS files can be marked as 'pending' in the browser (with caching disabled) for up to two minutes, after which they seem to download fine. This usually happens after a few refreshes. There aren't any errors shown, so I'm not sure how to investigate further. The same code runs fine on a Mac OSX environment. Node version is v0.10.31, Express is 4.8.5. Code for static file is: app.use(express.static(path.join(_