Giter VIP home page Giter VIP logo

react-and-django-deployment-with-ngnix's Introduction

react-and-django-deployment-with-ngnix

React

cd /home/frontend/
npm run build

Django

python3 manage.py runserver_plus 0.0.0.0:5600 --cert-file certifcate.crt --key-file server.key

Ngnix settings

/etc/nginx/sites-available$ sudo nano my_domain.com

server {

    listen 80;

    server_name  my_domain.com;

    return 301 https://$server_name$request_uri;

}

server {

      listen 443 ssl;       # Configure the Certificate and Key you got from your CA (e.g. Lets Encrypt)

      ssl_certificate     /home/frontend/certifcate.crt;

      ssl_certificate_key /home/frontend/server.key;       ssl_session_timeout 1d;

      ssl_session_cache shared:SSL:50m;

      ssl_session_tickets off;     # Only use TLS v1.2 as Transport Security Protocol

      ssl_protocols TLSv1.2;     # Only use ciphersuites that are considered modern and secure by Mozilla

      ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';     # Do not let attackers downgrade the ciphersuites in Client Hello

    # Always use server-side offered ciphersuites

      ssl_prefer_server_ciphers on;     # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)

      add_header Strict-Transport-Security max-age=15768000; 

         root /home/frontend/build;
        index index.html index.htm index.nginx-debian.html;         
        
        
        server_name my_domain.com;         
        location / {



                try_files $uri $uri/ =404;


        }
 

}

react-and-django-deployment-with-ngnix's People

Contributors

azizullah2017 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.