Skip to content

Instantly share code, notes, and snippets.

@Pavelob7
Created August 3, 2024 20:03
Show Gist options
  • Select an option

  • Save Pavelob7/09dd4d76f7b1bd8b94c04be3b26193e4 to your computer and use it in GitHub Desktop.

Select an option

Save Pavelob7/09dd4d76f7b1bd8b94c04be3b26193e4 to your computer and use it in GitHub Desktop.
nginx + next js
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
```
@ShilGen
Copy link

ShilGen commented Aug 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment