A small application for rating movies
gunicorn -u www -g www --worker-class eventlet -w 1 -D cineapp:app
Be careful just having one worker. If there is more than one, SocketIO will generate a lot of bad requests with 400 error code.
RewriteEngine on
# socket.io 1.0+ starts all connections with an HTTP polling request
RewriteCond %{QUERY_STRING} transport=polling [NC]
RewriteRule /(.*) http://localhost:8000/$1 [P]
# When socket.io wants to initiate a WebSocket connection, it sends an
# "upgrade: websocket" request that should be transferred to ws://
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://localhost:8000/$1 [P]
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
We send these headers to the application in order to have the external URLs correctly generated.
ProxyPreserveHost On
RequestHeader set Host "cineapp.ptitoliv.net"
RequestHeader set X-Forwarded-Proto "https"
Don't proxify static content
ProxyPassMatch ^/static !