Skip to content

Commit 4fd36b9

Browse files
committed
added django_sample project , nginx conf files for gunicorn and uwsgi. updated uwsgi.ini, run.sh, nginx's log style.
1 parent f4b8d2c commit 4fd36b9

7,294 files changed

Lines changed: 30215 additions & 869373 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/app-server/uwsgi/uwsgi.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[uwsgi]
2-
project = django_test
2+
project = django_sample
33
username = root
44

55
#uid = root
66
#gid =
7-
#base =/www/py37/django_test/repo
7+
#base =/www/django_sample/django_sample
88

99
# Django-related settings
1010
# the base directory (full path)
11-
chdir = /www/py37/django_test/repo
11+
chdir = /www/django_sample
1212

1313
# Django's wsgi file
14-
module = conf.wsgi:application
14+
module = django_sample.wsgi:application
1515

1616

1717
# python path
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
server {
2+
listen 80;
3+
server_name localhost www.localhost;
4+
5+
access_log /log/nginx/django_sample.com.access.log main;
6+
error_log /log/nginx/django_sample.com.error.log warn;
7+
8+
# Django media
9+
location /media {
10+
gzip_static on;
11+
expires max;
12+
#alias /www/django_sample/django_sample/media;
13+
alias /www/django_sample/media; # your Django project's media files - amend as required
14+
#include /etc/nginx/mime.types;
15+
}
16+
17+
location /static {
18+
gzip_static on;
19+
expires max;
20+
#alias /www/django_sample/django_sample/static;
21+
# normally static folder is named as /static
22+
alias /www/django_sample/static; # your Django project's static files - amend as required
23+
#include /etc/nginx/mime.types;
24+
}
25+
26+
location / {
27+
proxy_pass http://gunicorn-app:8000;
28+
# proxy_redirect http:// https://;
29+
30+
}
31+
32+
# Allow Lets Encrypt Domain Validation Program
33+
location ^~ /.well-known/acme-challenge/ {
34+
allow all;
35+
}
36+
37+
# Block dot file (.htaccess .htpasswd .svn .git .env and so on.)
38+
location ~ /\. {
39+
deny all;
40+
}
41+
42+
# Block (log file, binary, certificate, shell script, sql dump file) access.
43+
location ~* \.(log|binary|pem|enc|crt|conf|cnf|sql|sh|key|yml|lock)$ {
44+
deny all;
45+
}
46+
47+
# Block access
48+
location ~* (composer\.json|composer\.lock|composer\.phar|contributing\.md|license\.txt|readme\.rst|readme\.md|readme\.txt|copyright|artisan|gulpfile\.js|package\.json|phpunit\.xml|access_log|error_log|gruntfile\.js)$ {
49+
deny all;
50+
}
51+
52+
location = /favicon.ico {
53+
log_not_found off;
54+
access_log off;
55+
}
56+
57+
location = /robots.txt {
58+
log_not_found off;
59+
access_log off;
60+
}
61+
}

config/web-server/nginx/gunicorn/nginx_conf/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ http {
7676
image/webp
7777
application/font-woff
7878
application/json
79-
application/javascript
80-
;
79+
application/javascript;
8180

8281
include /etc/nginx/proxy_params;
8382
include /etc/nginx/conf.d/*.conf;

config/web-server/nginx/gunicorn/sample_nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ server {
22
listen portnumber;
33
server_name domain www.domain;
44

5-
access_log /log/nginx/filename.com.access.log main;
6-
error_log /log/nginx/filename.com.error.log warn;
5+
access_log /log/nginx/filename.com.gunicorn_access.log main;
6+
error_log /log/nginx/filename.com.gunicorn_error.log warn;
77

88
# Django media
99
location /media {

config/web-server/nginx/gunicorn/sample_nginx_https.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ server {
2929
ssl_stapling on; # Requires nginx >= 1.3.7
3030
ssl_stapling_verify on; # Requires nginx => 1.3.7
3131

32-
access_log /log/nginx/filename.access.log main;
33-
error_log /log/nginx/filename.error.log warn;
32+
access_log /log/nginx/filename.com.gunicorn_access.log main;
33+
error_log /log/nginx/filename.com.gunicorn_error.log warn;
3434

3535
# Django media
3636
location /media {

config/web-server/nginx/gunicorn/sample_nginx_proxy.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ server {
77
listen portnumber;
88
server_name domain www.domain;
99

10-
access_log /log/nginx/filename.access.log main;
11-
error_log /log/nginx/filename.error.log warn;
10+
access_log /log/nginx/filename.gunicorn_proxy_access.log main;
11+
error_log /log/nginx/filename.gunicorn_proxy_error.log warn;
1212
# Log Location. Can be anywhere. Make sure the nginx user defined in /etc/nginx/nginx.conf has r/w permissions
1313

1414
###

config/web-server/nginx/gunicorn/sample_nginx_proxy_https.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ server {
3232
ssl_stapling on; # Requires nginx >= 1.3.7
3333
ssl_stapling_verify on; # Requires nginx => 1.3.7
3434

35-
access_log /log/nginx/filename.access.log main;
36-
error_log /log/nginx/filename.error.log warn;
35+
access_log /log/nginx/filename.gunicorn_proxy_access.log main;
36+
error_log /log/nginx/filename.gunicorn_proxy_error.log warn;
3737

3838
# # Allow Lets Encrypt Domain Validation Program
3939
# location ^~ /.well-known/acme-challenge/ {

config/web-server/nginx/php/conf.d/sample_php_ng.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
server {
22
listen 80;
3-
server_name sample.com www.sample.com;
4-
root /www/sample;
3+
server_name localhost;
4+
root /www/php_sample;
55

66
server_tokens off;
77

@@ -20,8 +20,8 @@ server {
2020
#set same size as post_max_size(php.ini or php_admin_value).
2121
client_max_body_size 10M;
2222

23-
access_log /log/nginx/sample.com.access.log main;
24-
error_log /log/nginx/sample.com.error.log warn;
23+
access_log /log/nginx/php_sample.com.access.log main;
24+
error_log /log/nginx/php_sample.com.error.log warn;
2525

2626
location / {
2727
index index.php index.html;

config/web-server/nginx/php/nginx_conf/nginx.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ http {
7676
image/webp
7777
application/font-woff
7878
application/json
79-
application/javascript
80-
;
79+
application/javascript;
8180

8281
include /etc/nginx/conf.d/*.conf;
8382
include /etc/nginx/proxy_params;

config/web-server/nginx/php/sample_nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ server {
33
server_name domain www.domain;
44
root /www/webroot;
55

6-
access_log /log/nginx/filename.com.access.log main;
7-
error_log /log/nginx/filename.com.error.log warn;
6+
access_log /log/nginx/filename.com.php_access.log main;
7+
error_log /log/nginx/filename.com.php_error.log warn;
88

99
location / {
1010
index index.php index.html;

0 commit comments

Comments
 (0)