Skip to content

Commit a74f55e

Browse files
committed
- Fix create-envfile and uwsgi.ini proxy
1 parent febefa8 commit a74f55e

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.env.sample

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ BROKER_URL=amqp://guest:guest@rabbitmq:5672/
4141
CELERY_BEAT_SCHEDULER=celery.beat:PersistentScheduler
4242
ASYNC_SIGNALS=True
4343

44-
SITEURL=http://{hostname}/
44+
SITEURL={siteurl}/
4545

4646
ALLOWED_HOSTS="['django', '*', '{hostname}']"
4747

@@ -67,6 +67,7 @@ JENKINS_HTTPS_PORT=9443
6767
# #################
6868
GEONODE_LB_HOST_IP={hostname}
6969
GEONODE_LB_PORT=80
70+
PUBLIC_PORT={public_port}
7071

7172
# IP or domain name and port where the server can be reached on HTTPS (leave HOST empty if you want to use HTTP only)
7273
# port where the server can be reached on HTTPS
@@ -240,7 +241,7 @@ LDAP_GROUP_PROFILE_MEMBER_ATTR=uniqueMember
240241
POSTGRESQL_MAX_CONNECTIONS=200
241242

242243
# Common containers restart policy
243-
RESTART_POLICY_CONDITION="on-failure"
244+
RESTART_POLICY_CONDITION="on-failure"
244245
RESTART_POLICY_DELAY="5s"
245246
RESTART_POLICY_MAX_ATTEMPTS="3"
246247
RESTART_POLICY_WINDOW=120s

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ local_settings.py
6464
.idea/
6565
.vscode/
6666
.vagrant/
67-
Vagrantfile
67+
Vagrantfile
68+
/.env

create-envfile.py

+2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ def _get_vals_to_replace(args):
8181
}
8282
tcp = 'https' if ast.literal_eval(f"{_jsfile.get('https', args.https)}".capitalize()) else 'http'
8383

84+
_vals_to_replace["public_port"] = '443' if ast.literal_eval(f"{_jsfile.get('https', args.https)}".capitalize()) else '80'
8485
_vals_to_replace["http_host"] = _jsfile.get("hostname", args.hostname) if tcp == 'http' else ""
8586
_vals_to_replace["https_host"] = _jsfile.get("hostname", args.hostname) if tcp == 'https' else ""
8687

88+
_vals_to_replace["siteurl"] = f"{tcp}://{_jsfile.get('hostname', args.hostname)}"
8789
_vals_to_replace["geoserver_ui"] = f"{tcp}://{_jsfile.get('hostname', args.hostname)}"
8890
_vals_to_replace["secret_key"] = _jsfile.get("secret_key",args.secret_key) or "".join(random.choice(_strong_chars) for _ in range(50))
8991
_vals_to_replace["letsencrypt_mode"] = "disabled" if not _vals_to_replace.get("https_host") else "production"

docker/nginx/geonode.conf.envsubst

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ location / {
140140
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
141141
proxy_set_header X-Forwarded-Proto $scheme;
142142
proxy_hide_header X-Frame-Options;
143+
proxy_request_buffering off;
143144

144145
# uwsgi_params
145146
include /etc/nginx/uwsgi_params;
@@ -149,6 +150,7 @@ location / {
149150

150151
# when a client closes the connection then keep the channel to uwsgi open. Otherwise uwsgi throws an IOError
151152
uwsgi_ignore_client_abort on;
153+
uwsgi_request_buffering off;
152154

153155
location ~* \.(?:js|jpg|jpeg|gif|png|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|ttf|rtf|swf|ico|flv|woff|woff2|svg|xml)$ {
154156
gzip_static always;

src/uwsgi.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[uwsgi]
2-
# socket = 0.0.0.0:8000
3-
http-socket = 0.0.0.0:8000
2+
socket = 0.0.0.0:8000
3+
# http-socket = 0.0.0.0:8000
44
logto = /var/log/geonode.log
55
# pidfile = /tmp/geonode.pid
66

0 commit comments

Comments
 (0)