-
-
Save stephen2m/ded95c4dd00b1bcd7af70a97203992a1 to your computer and use it in GitHub Desktop.
Example Nginx and Gunicorn configurations for GeoNode deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cd /home/user/geonode/geonode | |
source /home/user/.virtualenvs/geonode/bin/activate | |
exec /home/user/.virtualenvs/geonode/gunicorn wsgi:application \ | |
--workers=2 \ | |
--bind=0.0.0.0:8000 \ | |
--user=geonode --group=www-data --log-level=error \ | |
--log-file=/home/user/geonode/log/gunicorn.log 2>>/home/user/geonode/log/gunicorn.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name mydomain.org; | |
root /var/www; | |
access_log off; | |
error_log /home/user/geonode/log/nginx_error.log; | |
# serve staticfiles | |
location /static/ { | |
root /var/www; | |
expires 7d; | |
} | |
# serve mediafiles, default 'uploaded' in GeoNode | |
location /uploaded/ { | |
root /var/www; | |
expires 7d; | |
} | |
# geoserver proxy | |
location /geoserver/ { | |
proxy_pass http://127.0.0.1:8080/geoserver/; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
} | |
# gunicorn wsgi proxy | |
location / { | |
proxy_pass_header Server; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Scheme $scheme; | |
proxy_connect_timeout 20; | |
proxy_read_timeout 20; | |
proxy_pass http://127.0.0.1:8000/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment