proxy_pass http://server1
upstream django {
server unix:///var/www/Shop/shop.sock; # взаимодействие с uwsgi через веб-порт
}
server {
listen 80 default_server;
server_name wire-shop.ru www.wire-shop.ru;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2 default_server;
include /etc/nginx/snippets/ssl-wire-shop.ru.conf;
include /etc/nginx/snippets/ssl-params.conf;
server_name wire-shop.ru www.wire-shop.ru;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl http2;
include /etc/nginx/snippets/ssl-wire-shop.ru.conf;
include /etc/nginx/snippets/ssl-params.conf;
server_name wire-shop.ru www.wire-shop.ru;
charset utf-8;
# максимальный размер загружаемых на сервер данных
client_max_body_size 75M;
# обслуживание медиа файлов и статики
location /media/ {
alias /var/www/Shop/Shop/templates/media/;
}
location /static {
alias /var/www/Shop/Shop/templates/static;
}
location /api/v0 {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
uwsgi_pass django;
include /var/www/Shop/uwsgi_params;
}
}
var express = require('express');
var app = express();
var path = require("path")
app.use(["/assets", "/user/assets", "/user/message/assets"], express.static(path.join(__dirname, "/assets")))
app.get('*', function (req, res) {
res.sendFile(path.join(__dirname, '/index.html'));
});
app.listen(3000, () => {
console.log("hi")
});
server {
listen 80 default_server;
root /var/www/nodejs;
index index.html;
error_page 400 401 402 403 404 500 501 502 503 /error;
server_name 206.189.62.203;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host #host;
}
location ^~ /nginx {
root /var/www;
}
}