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

Configuring a Reverse proxy for geonode installation #4113

Closed
sandeepgadhwal opened this issue Dec 10, 2018 · 4 comments
Closed

Configuring a Reverse proxy for geonode installation #4113

sandeepgadhwal opened this issue Dec 10, 2018 · 4 comments

Comments

@sandeepgadhwal
Copy link

hello everyone i have setuped geonode 2.8 on an ubuntu 16.04 machine in my lan network and updated the same in geonode config also by using command geonode-upateip. I have a reverse proxy server that hosts other servers on public ip at designated subfolders, i tried to configure this sdi also but it fails for some reason and geonode is not able to detect the folder and hits for assets at top level domain only my code is :-

location /sdi/ {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://172.16.16.243:5000 ;
    }

problem is it is hitting

http://domain/static/lib/css/assets.min.css?v=2.8
instead of
http://domain/sdi/static/lib/css/assets.min.css?v=2.8

can anyone help

@afabiani
Copy link
Member

afabiani commented Dec 10, 2018

Hi @sandeepgadhwal
in order to deploy GeoNode on a sub-path you will need to do the following:

  1. Update the variables on settings (or local_settings) by putting in there the full path

e.g.:

 SITEURL = 'http://<my_ip_or_domain>/sdi/'
 FORCE_SCRIPT_NAME = '/sdi'
 MEDIA_URL = '/sdi/uploaded/'
 STATIC_URL = '/sdi/static/'
 LOGIN_URL = os.getenv('LOGIN_URL', '{}account/login/'.format(SITEURL))
 LOGOUT_URL = os.getenv('LOGOUT_URL', '{}account/logout/'.format(SITEURL)) 
 ACCOUNT_LOGIN_REDIRECT_URL = os.getenv('LOGIN_REDIRECT_URL', SITEURL)
 ACCOUNT_LOGOUT_REDIRECT_URL =  os.getenv('LOGOUT_REDIRECT_URL', SITEURL)
  1. Use NGINX HTTPD Server (Apache HTTPD won't work unfortunately) by configuring UWSGI as following:

NGINX

       location /sdi {
                etag off;
                uwsgi_pass 127.0.0.1:8000;
                uwsgi_param UWSGI_SCRIPT sdi;
                uwsgi_read_timeout 600s;
                include uwsgi_params;
        }

        location /sdi/static/ {
                alias /full_path_to/static_root/;
        }

        location /sdi/uploaded/ {
                alias /full_path_to/uploaded/;
        }

UWSGI.ini

 [uwsgi]
 socket = 0.0.0.0:8000
 uid = ****
 gid = ****
 plugins = python
 virtualenv = /full_path_to_venv
 # geonode.settings or geonode.local_settings depending on your setup
 env = DJANGO_SETTINGS_MODULE=geonode.settings
 chdir = /full_path_to_geonode_src_code
 mount = /sdi=/full_path_to_geonode_src_code/wsgi.py
 manage-script-name = true
 processes = 2
 threads = 3
 enable-threads = true
 master = true
 touch-reload = /full_path_to_geonode_src_code/wsgi.py
 buffer-size = 32768
 vacuum = true
 thunder-lock = true
  1. Make sure the GeoServer REST Role Service is specifying the correct endpoints

image

image

image

@sandeepgadhwal
Copy link
Author

sandeepgadhwal commented Dec 10, 2018 via email

@t-book
Copy link
Contributor

t-book commented Dec 11, 2018

Nice this should find it´s way into docs.

@t-book
Copy link
Contributor

t-book commented Jun 14, 2019

It looks this is resolved by the comment of @afabiani closing here.

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

3 participants