M
M
mashincode2022-02-01 23:52:22
css
mashincode, 2022-02-01 23:52:22

Difficulty in understanding Apache after using NGINX, how to simplify?

I have a Django project in docker
Build NGINX/POSTGRESS/GUNICORN

And I usually use nginx config which looks like this and basically forwards all connections to port 8000

server {
   client_max_body_size 100M;

    listen 443 ssl;
    listen [::]:443 ssl;
    #ssl_certificate_key /etc/nginx/conf.d/nginx-selfsigned.key;
    #ssl_certificate /etc/nginx/conf.d/nginx-selfsigned.pem;

    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem;
    server_tokens off;

    location /static/ {
        autoindex off;
        alias /static/;
    }

    location /media/ {
        autoindex on;
        alias /media/;
    }

    location /admin {
        try_files $uri $uri/ @python_django;
    }

    location / {
        try_files $uri $uri/ @python_django;
    }

    location @python_django {
        proxy_pass http://python:8000;
        proxy_pass_request_headers on;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
    }
}


My client insisted on using Apache and googling tutorials on it, everywhere we specify a direct path to the static and wsgi file, which seems a little strange to me, and I don’t understand how migrations and so on will work if they are inside the docker container, as well as linking with database and it confuses me a lot

Alias /static /home/8host/myproject/static
        <Directory /home/8host/myproject/static>
        Require all granted
        </Directory>
        <Directory /home/8host/myproject/myproject>
        <Files wsgi.py>
        Require all granted
        </Files>
        </Directory>
        WSGIDaemonProcess myproject python-home=/home/8host/myproject/myprojectenv python-path=/home/8host/myproject
        WSGIProcessGroup myproject
        WSGIScriptAlias / /home/8host/myproject/myproject/wsgi.py


In general, is it possible to repeat in Apache the same scheme as I have with NGINX and so that Apache would be running on the client on the server, I made a config for it and on the same server I raised my docker assembly, only this time I did not add into it Nginx?

If so, please share an example.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2016-01-06
@mr_ko

I don’t know about ionic, but for angular there is a good carousel https://github.com/devmark/angular-slick-carousel

N
Nikolai Turnaviotov, 2022-02-02
@foxmuldercp

It is better to throw out Apache from this sheaf. it is much slower and less secure than Nginx.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question