Skip to content

Commit

Permalink
More Prod Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vCra committed Apr 28, 2019
1 parent 6d55ad9 commit 6283128
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
52 changes: 52 additions & 0 deletions compose/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# nginx.conf
events { }

http {
# the upstream component nginx needs to connect to


# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name localhost; # substitute your machine's IP address or FQDN
charset utf-8;

# max upload size
client_max_body_size 75M; # adjust to taste
ignore_invalid_headers off;

location /media/ {
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_pass http://minio:9000;
}

location /static/ {
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_pass http://minio:9000;
}

location / {
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_pass http://django:8000;
}

location /ws {
proxy_pass http://django:8000;
proxy_set_header Host $host;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
}
12 changes: 12 additions & 0 deletions config/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
ASGI entrypoint. Configures Django and then runs the application
defined in the ASGI_APPLICATION setting.
"""

import os
import django
from channels.routing import get_default_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
django.setup()
application = get_default_application()
4 changes: 2 additions & 2 deletions gulpfile.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var gulp = require('gulp'),
rename = require('gulp-rename'),
plumber = require('gulp-plumber'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
imagemin = require('gulp-imagemin');


// Relative paths function
Expand Down Expand Up @@ -97,5 +97,5 @@ gulp.task('watch', function () {
});

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

0 comments on commit 6283128

Please sign in to comment.