Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx config. #247

Closed
alexdatur opened this issue Oct 20, 2024 · 0 comments
Closed

Nginx config. #247

alexdatur opened this issue Oct 20, 2024 · 0 comments

Comments

@alexdatur
Copy link

Hi! Using service behind CF and Nginx. van somebody gives best practice nginx config?
Thanx.
My config:

server {
listen 80;
server_name ip.***.xyz;

# Редирект с HTTP на HTTPS
return 301 https://$host$request_uri;

}

server {
listen 443 ssl;
server_name ip.***.xyz;

# Параметры SSL
ssl_certificate /var/docker/cloudflare_tls/origin.pem;
ssl_certificate_key /var/docker/cloudflare_tls/key.pem;

# Дополнительные параметры SSL (рекомендуется)
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'HIGH:!aNULL:!MD5';
ssl_prefer_server_ciphers on;

# Настройки для вашего приложения
location / {
    proxy_pass http://localhost:18966;  # Прокси на ваш сервис
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;

    # Установка заголовков для безопасности
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header Referrer-Policy no-referrer-when-downgrade;
}

# Логи (опционально)
access_log /var/log/nginx/ip.***.xyz.access.log;
error_log /var/log/nginx/ip.***.xyz.error.log;

}

@alexdatur alexdatur added the enhancement New feature or request label Oct 20, 2024
@jason5ng32 jason5ng32 removed the enhancement New feature or request label Oct 24, 2024
Repository owner locked and limited conversation to collaborators Oct 30, 2024
@jason5ng32 jason5ng32 converted this issue into discussion #251 Oct 30, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants