Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadhabibi14 committed Jan 25, 2024
1 parent 2f1ab8e commit 38f28c1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions perpus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
'perpus.middleware.ContentTypeMiddleware',
]

SECURE_CROSS_ORIGIN_OPENER_POLICY = None

RATELIMIT_VIEW = 'perpus.views.ratelimited_error'

ROOT_URLCONF = 'perpus.urls'
Expand Down
17 changes: 17 additions & 0 deletions scripts/gunicorn.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=root_admin
Group=www-data
WorkingDirectory=/home/root_admin/bacaku
ExecStart=/home/root_admin/bacaku/.venv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
perpus.wsgi:application

[Install]
WantedBy=multi-user.target
8 changes: 7 additions & 1 deletion scripts/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ server {

server_name 193.111.124.179;

location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/root_admin/bacaku;
}

gzip on;

gzip_types
Expand All @@ -33,7 +38,8 @@ server {
gzip_buffers 32 8k;

location / {
proxy_pass http://localhost:8000;
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down
2 changes: 1 addition & 1 deletion start_prod.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python manage.py runserver
gunicorn --bind 0.0.0.0:8000 perpus.wsgi

0 comments on commit 38f28c1

Please sign in to comment.