Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add to the docs: How to use behind Apache or NGINX #55

Open
guettli opened this issue Oct 17, 2013 · 2 comments
Open

Please add to the docs: How to use behind Apache or NGINX #55

guettli opened this issue Oct 17, 2013 · 2 comments

Comments

@guettli
Copy link

guettli commented Oct 17, 2013

Up to now there is nothing about "apache" in the docs:

https://readthedocs.org/search/project/?q=apache&selected_facets=project_exact%3Adjango-socketio

Please add some information how it can be used with apache.

Do you need to open a new port, or is it possible to use the proxy module?

Thank you.

@bytedreamer
Copy link

I was able to access django-socketio behind an Apache server. Here are the configuration steps I needed to perform to get it working.

  • The Apache server and django-socketio server need to be configured with different ports. The Apache is configured with the standard HTTP ports of 80 and 443. django-socketio server is configured with a different port, such as 8080 or 8443.
  • Setup Supervisor to run django-socketio as a service. I couldn't figure out how to setup it up using WSGI. So I execute the manage.py runserver_socketio command.
  • Edit the Javascript code to so the Socket IO connects to the Apache server. Notice I added a secure option for SSL connections.
var socket = new io.Socket('{{ socketio_host }}', { port: {{ socketio_po
rt }}, secure: {{ socketio_secure }} });
  • Update Apache to reverse proxy requests to the django_socketio server. The Apache server will need to have the mod_proxy module installed. Add the following two lines in the site's configuration file.
ProxyPass / http://my.server.com:8443/
ProxyPassReverse / http://my.server.com:8443/

@guettli
Copy link
Author

guettli commented Mar 19, 2015

@bytedreamer thank you for sharing!

@stephenmcd stephenmcd changed the title Please add to the docs: How to use behind Apache Please add to the docs: How to use behind Apache or NGINX Aug 30, 2016
This was referenced Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants