I
I
Igor2019-08-04 13:56:09
Nginx
Igor, 2019-08-04 13:56:09

Nginx won't start with Nuxt configuration?

Nginx won't start with config for Nuxt.
On the official Nuxt resource, I found how to configure the nginx server.

spoiler

map $sent_http_content_type $expires {
    "text/html"                 epoch;
    "text/html; charset=utf-8"  epoch;
    default                     off;
}

server {
    listen          80;             # the port nginx is listening on
    server_name     your-domain;    # setup your domain here

    gzip            on;
    gzip_types      text/plain application/xml text/css application/javascript;
    gzip_min_length 1000;

    location / {
        expires $expires;

        proxy_redirect                      off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_read_timeout          1m;
        proxy_connect_timeout       1m;
        proxy_pass                          http://127.0.0.1:3000; # set the adress of the Node.js instance here
    }
}


Key parameters:
proxy_pass
server_name
I'm deploying this whole thing under Windows + OpenServer
I don't see anything useful in the logs:
spoiler
2019-08-04 01:30:38  --------------------------------------------
2019-08-04 01:30:39  Начало процедуры запуска сервера
2019-08-04 01:30:41  Обновление Hosts файла
2019-08-04 01:30:41  Обновление конфигурации MySQL-8.0-x64
2019-08-04 01:30:41  Обновление конфигурации Sendmail
2019-08-04 01:30:41  Обновление конфигурации PHP_7.3-x64
2019-08-04 01:30:41  Обновление конфигурации PHPMyAdmin
2019-08-04 01:30:41  Обновление конфигурации Nginx_1.11
2019-08-04 01:30:41  Запуск MySQL-8.0-x64
2019-08-04 01:30:41  Запуск PHP_7.3-x64
2019-08-04 01:30:41  Запуск Nginx_1.11
2019-08-04 01:30:41  Проверка состояния сервера
2019-08-04 01:31:58  Не удалось запустить Nginx_1.11
2019-08-04 01:31:58  Сбой запуска!
2019-08-04 01:31:58  --------------------------------------------
2019-08-04 01:31:58  Начало процедуры остановки сервера
2019-08-04 01:31:58  Остановка системных модулей
2019-08-04 01:32:02  Отключение виртуального диска
2019-08-04 01:32:03  Сервер успешно остановлен за 5,437 секунд!

How do I create a new domain in OpenServer
In the directory "D:\OpenServer\OSPanel\domains" I create a directory (the name of my domain) I
also place the Nginx_1.11_vhost.conf file in it, since I do not plan to place application files in the same directory.
In the Nginx_1.11_vhost.conf file, I configure the server for the domain.
Where to look?
How to see other nginx logs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2019-08-04
@IgorPI

Colleagues, I found the logs

2019/08/04 14:01:52 [emerg] 15376#8580: could not build map_hash, you should increase map_hash_bucket_size: 32
2019/08/04 14:05:40 [emerg] 12020#17148: could not build map_hash, you should increase map_hash_bucket_size: 32
2019/08/04 14:06:49 [emerg] 13284#5700: could not build map_hash, you should increase map_hash_bucket_size: 32

in server config, http context
set config
http {
  map_hash_bucket_size		  128;
  ...

As the grandmother whispered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question