modified: main_dc/nginx/nginx-ssl.conf
modified: main_dc/valitovgaziz/analytics/server.js simplyfy nginx-ssl.conf and remove api from paths in server.js
This commit is contained in:
@@ -78,8 +78,8 @@ server {
|
||||
}
|
||||
|
||||
# Проксирование для аналитики
|
||||
location /api/analytics {
|
||||
proxy_pass http://analytics:3000;
|
||||
location /api/ {
|
||||
proxy_pass http://analytics:3000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -101,24 +101,6 @@ server {
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# Health check для аналитики
|
||||
location /api/analytics/health {
|
||||
proxy_pass http://analytics:3000/health;
|
||||
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;
|
||||
}
|
||||
|
||||
# Статистика аналитики
|
||||
location /api/analytics/stats {
|
||||
proxy_pass http://analytics:3000/api/stats;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
|
||||
@@ -112,7 +112,7 @@ app.get('/health', (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/api/analytics', rateLimit, async (req, res) => {
|
||||
app.post('/analytics', rateLimit, async (req, res) => {
|
||||
try {
|
||||
const { events, sessionId } = req.body;
|
||||
|
||||
@@ -144,7 +144,7 @@ app.post('/api/analytics', rateLimit, async (req, res) => {
|
||||
});
|
||||
|
||||
// Статистика
|
||||
app.get('/api/stats', async (req, res) => {
|
||||
app.get('/stats', async (req, res) => {
|
||||
try {
|
||||
const dataDir = path.join(__dirname, 'data');
|
||||
|
||||
@@ -188,7 +188,7 @@ app.get('/api/stats', async (req, res) => {
|
||||
});
|
||||
|
||||
// Информация о сервисе
|
||||
app.get('/api/info', (req, res) => {
|
||||
app.get('/info', (req, res) => {
|
||||
res.json({
|
||||
service: 'analytics-server',
|
||||
version: '1.0.0',
|
||||
|
||||
Reference in New Issue
Block a user