Created
August 3, 2024 20:03
-
-
Save Pavelob7/09dd4d76f7b1bd8b94c04be3b26193e4 to your computer and use it in GitHub Desktop.
nginx + next js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Установить npm и nginx | |
| ``` | |
| sudo apt install nodejs npm | |
| sudo apt install nginx | |
| ``` | |
| 2. Скачать всё с данной ветки (readme можно удалить) | |
| 3. Засунуть на сервак | |
| 4. Перейти, куда запихнули | |
| ``` | |
| cd путь_до_папки_с_фронтом | |
| ``` | |
| 5. Прописать: | |
| ``` | |
| npm install --production | |
| npm start | |
| ``` | |
| 6. По умолчанию запустится приложение по адресу localhost:3000 | |
| 7. Зайти в папку nginx\conf и в файле nginx.conf в разделе location / { прописать: | |
| ``` | |
| proxy_pass http://localhost:3000; # Порт, на котором запущен Next.js сервер | |
| ``` | |
| 8. Прописать: | |
| ``` | |
| start nginx | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://nodejs.org/en/download/package-manager