Skip to content

Commit

Permalink
Delete comments from conf nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil-Zlo committed Dec 17, 2024
1 parent 975fdb1 commit eb97a10
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 67 deletions.
29 changes: 8 additions & 21 deletions config/default
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ server {

location = /error.html {
alias /var/www/mysite/2024_2_TeamOn/src/app/styles/photos/error.html;
# expires 30d;
# add_header Cache-Control "public, no-transform";
#error_page 404 = /var/www/mysite/2024_2_TeamOn/src/app/styles/photos/;

}
}


location ^~ /static/ {
Expand All @@ -47,7 +43,6 @@ server {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'X-CSRF-Token, Content-Type';
add_header 'Access-Control-Allow-Methods' 'GET, POST';
# add_header "Access-Control-Allow-Origin" "*";
add_header "Access-Control-Allow-Headers" "X-CSRF-Token, Origin, X-Requested-With, Content-Type, Accept";

# Проксирование запросов к /api/auth/token-endpoint
Expand Down Expand Up @@ -80,9 +75,9 @@ server {
rewrite ^/api/accounts/account/update/role /account/update/role break;
rewrite ^/api/accounts/account/update /account/update break;
rewrite ^/api/accounts/account /account break;
rewrite ^/api/accounts/notification/status/update /notification/status/update break;
rewrite ^/api/accounts/notification/new /notification/new break;
rewrite ^/api/accounts/notification /notification break;
rewrite ^/api/accounts/notification/status/update /notification/status/update break;
rewrite ^/api/accounts/notification/new /notification/new break;
rewrite ^/api/accounts/notification /notification break;



Expand All @@ -99,16 +94,15 @@ server {
rewrite ^/api/pages/token-endpoint /token-endpoint break;
rewrite ^/api/pages/author/(.*)/background /author/$1/background break;
rewrite ^/api/pages/author/(.*)/tip /author/$1/tip break;
# rewrite ^/api/pages/author/(.*) /author/$1 break;
rewrite ^/api/pages/author/payments /author/payments break;
rewrite ^/api/pages/author/update/background /author/update/background break;
rewrite ^/api/pages/author/update/info /author/update/info break;
rewrite ^/api/pages/subscription/request /subscription/request break;
rewrite ^/api/pages/payment/realize /payment/realize break;
rewrite ^/api/pages/unsubscription /unsubscription break;
rewrite ^/api/pages/stat/posts /stat/posts break;
rewrite ^/api/pages/stat/payments /stat/payments break;
rewrite ^/api/pages/author/(.*) /author/$1 break;
rewrite ^/api/pages/stat/posts /stat/posts break;
rewrite ^/api/pages/stat/payments /stat/payments break;
rewrite ^/api/pages/author/(.*) /author/$1 break;


proxy_pass http://backend_author;
Expand All @@ -124,12 +118,11 @@ rewrite ^/api/pages/author/(.*) /author/$1 break;
rewrite ^/api/posts/token-endpoint /token-endpoint break;
rewrite ^/api/posts/feed/popular /feed/popular break;
rewrite ^/api/posts/feed/subscriptions /feed/subscriptions break;
rewrite ^/api/posts/posts/(.*)/comments/create /posts/$1/comments/create break;
rewrite ^/api/posts/posts/(.*)/comments/create /posts/$1/comments/create break;

rewrite ^/api/posts/posts/(.*)/comments /posts/$1/comments break;
rewrite ^/api/posts/posts/comments/(.*)/update /posts/comments/$1/update break;
rewrite ^/api/posts/posts/comments/(.*)/delete /posts/comments/$1/delete break;
#rewrite ^/api/posts/posts/(.*)/comments/create /posts/$1/comments/create break;

rewrite ^/api/posts/post/like /post/like break;
rewrite ^/api/posts/post/update /post/update break;
Expand Down Expand Up @@ -248,12 +241,6 @@ rewrite ^/api/pages/author/(.*) /author/$1 break;
expires 30d;
add_header Cache-Control "public, no-transform";
}
# location = /error.html {
# try_files $uri =404;
# alias /var/www/mysite/2024_2_TeamOn/src/app/styles/photos/;
# expires 30d;
# add_header Cache-Control "public, no-transform";
#}

ssl_certificate /etc/letsencrypt/live/pushart.online/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pushart.online/privkey.pem;
Expand Down
62 changes: 16 additions & 46 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,16 @@ include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 15m;

##
# SSL Settings
##

#ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
# ssl_prefer_server_ciphers on;

##
# Logging Settings
##
client_max_body_size 15m;

access_log /var/log/nginx/access.log;

Expand All @@ -52,36 +31,27 @@ client_max_body_size 15m;
upstream backend_posts {
server localhost:8084;
}
upstream backend_tech {
server localhost:8085;
}
upstream backend_csat {
server localhost:8086;
}
upstream backend_tech {
server localhost:8085;
}
upstream backend_csat {
server localhost:8086;
}
upstream backend_grafana {
server localhost:3000;
}
upstream backend_moderation {
server localhost:8087;
}

##
# Gzip Settings
##
upstream backend_moderation {
server localhost:8087;
}

gzip on;

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


##
# Virtual Host Configs
##
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
Expand Down

0 comments on commit eb97a10

Please sign in to comment.