Hi all,
I have a pyramid app on Dreamhost, and they are reverting from using Ruby's
passenger back to fcgi fro shared hosting accounts. The server runs Apache,
and I have control of .htaccess configuration.
At the moment, I am able to serve static files by using
`config.add_static_view`, but it does not appear to be working for things
like videos hosted on site (.mp4) nor audio (.ogg).
I thought to bypass `add_static_view` and have Apache serve static assets
itself, but it's brought no joy, since apparently, my setup doesn't allow
`Alias` directives, and the `RewriteCond` for files doesn't play well with
Pyramid's layout, with or without `add_static_view`. The basic site seems
to work better when I use Pyramid to serve, but like I said, video and
audio files are blocked somehow. How do I serve .mp4 and .ogg? Do I have to
get into declaring things iwth the `mimetypes` lib?
Here's my .htaccess, for reference:
$ cat .htaccess
#Disables GZIP
SetEnv no-gzip 1
#Turns off the expires headers for Apache
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
# DISABLE CACHING
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
Options +ExecCGI
AddHandler fcgid-script .fcgi
SetHandler fcgid-script
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]
And here is my `dispatch.fcgi`:
#!/home/untwelve_admin/untwelve.dreamhosters.com/bin/python3.12
import sys
from paste.deploy import loadapp
from flup.server.fcgi_fork import WSGIServer
sys.path.append("UnTwelveDotOrg")
app = loadapp(
"config:/home/untwelve_admin/untwelve.dreamhosters.com/UnTwelveDotOrg/development.ini"
)
if __name__ == "__main__":
WSGIServer(app).run()
Thanks for any insights you can provide!
Best,
Aaron
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/2df33b45-96b9-4812-9eed-72f58861af12n%40googlegroups.com.