Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

NGINX setup for react plus django (rest framework) in same server

server_tokens               off;
access_log                  /var/log/nginx/mysite.access.log;
error_log                   /var/log/nginx/mysite.error.log;

# This configuration will be changed to redirect to HTTPS later
server {
  server_name               .example.com;
  listen                    80;
  location / {
        root   /var/www/html;  # location for React build files
        index  index.html index.htm;	# entry point for NGINX
		try_files $uri $uri/ /index.html;
  }

  location /akn {
        try_files $uri @proxy_api;	# call to pass proxy
  }
  location /admin {
    	try_files $uri @proxy_api;  # to use the default django admin
  }

  location @proxy_api {
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Url-Scheme $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass   http://localhost:8000;
   }

  location /staticfiles {
	autoindex on;
	alias /var/www/akn/static/;
  }
}
Comment

NGINX setup for react plus django (rest framework) in same server

server_tokens               off;
access_log                  /var/log/nginx/mysite.access.log;
error_log                   /var/log/nginx/mysite.error.log;

# This configuration will be changed to redirect to HTTPS later
server {
  server_name               .example.com;
  listen                    80;
  location / {
        root   /var/www/html;  # location for React build files
        index  index.html index.htm;	# entry point for NGINX
		try_files $uri $uri/ /index.html;
  }

  location /akn {
        try_files $uri @proxy_api;	# call to pass proxy
  }
  location /admin {
    	try_files $uri @proxy_api;  # to use the default django admin
  }

  location @proxy_api {
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Url-Scheme $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass   http://localhost:8000;
   }

  location /staticfiles {
	autoindex on;
	alias /var/www/akn/static/;
  }
}
Comment

PREVIOUS NEXT
Code Example
Shell :: comentarios shell script 
Shell :: calibre on centos terminal 
Shell :: Command to get list of shell variables in bash 
Shell :: Auto-open DevTools on every new tab For cmd on Windows 
Shell :: ssm terraform login to ec2 
Shell :: concatenation in shell script 
Shell :: open github code editor online 
Shell :: python tree library 
Shell :: bash find files containing string 
Shell :: how to make a function in bash 
Shell :: postgre create user 
Shell :: install protobuf windows 
Shell :: git how to learn 
Shell :: github pull request template 
Shell :: delete github branch 
Shell :: dlib installation 
Shell :: how to create an alias in bash 
Shell :: bash awk or 
Shell :: string powershell 
Shell :: jenkins local 
Shell :: tkPDFViewer install 
Shell :: gatsby-plugin-feed-generator 
Shell :: gh_token environment variable powershell 
Shell :: bokura no kiseki wikipedia 
Php :: how to make a php info 
Php :: laravel get project root 
Php :: get start of month end of month carbon 
Php :: php keep only numbers in string 
Php :: forget or remove a session in laravel 
Php :: woocommerce disable zoom on product image 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =