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

Setting a base url with: SITE_PREFIX_URL #771

Open
1 task done
DaveGhedini opened this issue Mar 4, 2024 · 6 comments
Open
1 task done

Setting a base url with: SITE_PREFIX_URL #771

DaveGhedini opened this issue Mar 4, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@DaveGhedini
Copy link

DaveGhedini commented Mar 4, 2024

Checklist

  • I've searched through the current issues to make sure this feature hasn't been requested already.

Motivation

Motivation
I would like to run g3w-suite in a specific url location (e.g. /g3w).
I run g3w behind an Apache proxy and updating below
<Location "/"> Require all granted ProxyPass unix:/opt/g3wsuite/g3w-admin.sock|uwsgi://uwsgi-g3w-admin/ </Location>

to:

<Location "/g3w"> Require all granted ProxyPass unix:/opt/g3wsuite/g3w-admin.sock|uwsgi://uwsgi-g3w-admin/ </Location>

This works for most items, but not for maps, which cannot be loaded.

It would be very good to have BASE_URL or BASE_PROXY_URL setting that can be configured.

Suggested solution

Add BASE_URL or BASE_PROXY_URL setting.

Alternatives considered

No response

@DaveGhedini DaveGhedini added the feature New feature or request label Mar 4, 2024
@volterra79 volterra79 transferred this issue from g3w-suite/g3w-client Mar 4, 2024
@tudorbarascu
Copy link
Contributor

I would also be interested in this feature 👍

@wlorenzetti
Copy link
Member

Hi everybody :), @DaveGhedini try to us the settings SITE_PREFIX_URL, I'm not sure because is a very old setting..

@Raruto
Copy link
Contributor

Raruto commented Apr 15, 2024

@tudorbarascu @DaveGhedini can we close this?

@DavidGhedini
Copy link

Sorry, checking this now. You can close and I can re-open if needed. Thanks again.

@Raruto Raruto changed the title Add BASE_URL Setting Setting a base url with: SITE_PREFIX_URL Apr 16, 2024
@Raruto Raruto added question Further information is requested and removed feature New feature or request labels Apr 16, 2024
@Raruto Raruto closed this as completed Apr 16, 2024
@DavidGhedini
Copy link

DavidGhedini commented Jul 4, 2024

Just to follow up, SITE_PREFIX_URL did not change behavior.
The only url that does not work properly using <Location "/g3w"> is the ows url.
Everything else works fine.

@Raruto
Copy link
Contributor

Raruto commented Jul 5, 2024

Hi @DaveGhedini,

this should be the relevant code:

apiUrlpatterns += [
path('', include('client.apiurls')),
path('', include('core.apiurls')),
path('', include('usersmanage.apiurls')),
# TODO find out why we cannot include('OWS.apiurls') instead
path('', include('OWS.urls')),
]

#############################################################
# SITE PREFIX
#############################################################
if settings.SITE_PREFIX_URL:
urlpatterns = [ path('{}'.format(settings.SITE_PREFIX_URL), include(urlpatterns)) ]
apiUrlpatterns = [ path('{}'.format(settings.SITE_PREFIX_URL), include(apiUrlpatterns)) ]

urlpatterns = [
#############################################################
# Main OWS client
#############################################################
re_path(
r'^ows/(?P<map_name_alias>[-_\w\d]+)/&?$',
ows_alias_view,
name='ows-alias'
),
re_path(
r'^ows/(?P<group_slug>[-_\w\d]+)/(?P<project_type>[-_\w\d]+)/(?P<project_id>[-_\w\d]+)/&?$',
OWSView.as_view(),
name='ows'
),
re_path(
r'^ows/(?P<group_slug>[-_\w\d]+)/(?P<project_type>[-_\w\d]+)/(?P<project_id>[-_\w\d]+)/wfs3&?',
OWSView.as_view(),
name='ows-wfs3'
),
]

if you feel like debugging, otherwise please insert a link to a public demo project that clearly shows the problem.

@Raruto Raruto reopened this Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants