Skip to content

Commit 6283128

Browse files
committed
More Prod Changes
1 parent 6d55ad9 commit 6283128

File tree

3 files changed

+66
-2
lines changed

3 files changed

+66
-2
lines changed

compose/nginx.conf

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# nginx.conf
2+
events { }
3+
4+
http {
5+
# the upstream component nginx needs to connect to
6+
7+
8+
# configuration of the server
9+
server {
10+
# the port your site will be served on
11+
listen 80;
12+
# the domain name it will serve for
13+
server_name localhost; # substitute your machine's IP address or FQDN
14+
charset utf-8;
15+
16+
# max upload size
17+
client_max_body_size 75M; # adjust to taste
18+
ignore_invalid_headers off;
19+
20+
location /media/ {
21+
proxy_buffering off;
22+
proxy_set_header Host $http_host;
23+
proxy_pass http://minio:9000;
24+
}
25+
26+
location /static/ {
27+
proxy_buffering off;
28+
proxy_set_header Host $http_host;
29+
proxy_pass http://minio:9000;
30+
}
31+
32+
location / {
33+
proxy_buffering off;
34+
proxy_set_header Host $http_host;
35+
proxy_pass http://django:8000;
36+
}
37+
38+
location /ws {
39+
proxy_pass http://django:8000;
40+
proxy_set_header Host $host;
41+
42+
proxy_http_version 1.1;
43+
proxy_set_header Upgrade $http_upgrade;
44+
proxy_set_header Connection "upgrade";
45+
46+
proxy_redirect off;
47+
proxy_set_header X-Real-IP $remote_addr;
48+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
49+
proxy_set_header X-Forwarded-Host $server_name;
50+
}
51+
}
52+
}

config/asgi.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""
2+
ASGI entrypoint. Configures Django and then runs the application
3+
defined in the ASGI_APPLICATION setting.
4+
"""
5+
6+
import os
7+
import django
8+
from channels.routing import get_default_application
9+
10+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
11+
django.setup()
12+
application = get_default_application()

gulpfile.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var gulp = require('gulp'),
1212
rename = require('gulp-rename'),
1313
plumber = require('gulp-plumber'),
1414
uglify = require('gulp-uglify'),
15-
imagemin = require('gulp-imagemin'),
15+
imagemin = require('gulp-imagemin');
1616

1717

1818
// Relative paths function
@@ -97,5 +97,5 @@ gulp.task('watch', function () {
9797
});
9898

9999
gulp.task('build',
100-
gulp.parallel('styles', 'scripts', 'vendor-scripts', 'imgCompression', 'fontCollection')
100+
gulp.parallel('styles', 'scripts', 'vendor-scripts', 'fontCollection')
101101
);

0 commit comments

Comments
 (0)