Z
Z
ZaurK2018-08-21 14:02:47
Nginx
ZaurK, 2018-08-21 14:02:47

How to set up nginx in docker?

Hello! I decided to try to run laravel in docker, and when I run it I get the following error

400 Bad Request
The plain HTTP request was sent to HTTPS port

The site opens at https://localhost:8000/, but chrome swears at an insecure connection. Tell me how to make the site open at localhost:8000 or https://localhost:8000/ without errors?
Here are the settings at the beginning of the file default.conf
server {
listen 80;
index index.php index.html;
root /var/www/public;
# ssl on;
ssl_certificate /etc/nginx/ssl/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/nginx/ssl/ssl-cert-snakeoil.key;
index index.html;
location / {
try_files $uri /index.php?$args;
}
location /docs {
try_files $uri $uri/;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question