Quantcast
Channel: Nginx Forum - How to...
Viewing all 4759 articles
Browse latest View live

nginx does not show me txt files

$
0
0
Hello partners,

My nginx server does not display the .txt files in the "/" directory, I can not find where the fault is, can you help me?

The website is a multisite in wordpress.



#redirections pages
rewrite ^ / blog /(.*)$ / blogs / $ 1 permanent;

#Forced SSH
if ($ ssl_protocol = "") {
rewrite ^ / (. *) https: // $ server_name / $ 1 permanent;
}

#ignored: "-" thing used or unknown variable in regex / rew
rewrite ^ / ([_ 0-9a-zA-Z -] + /)? wp-admin $ / $ 1wp-admin / permanent;
if (-f $ request_filename) {
set $ rule_2 1;
}
if (-d $ request_filename) {
set $ rule_2 1;
}
if ($ rule_2 = "1") {
#ignored: "-" thing used or unknown variable in regex / rew
}
rewrite ^ / ([_ 0-9a-zA-Z -] + /)? (wp- (content | admin | includes).) / $ 2 last;
rewrite ^ / ([_ 0-9a-zA-Z -] + /)? (. * \. php) $ / $ 2 last;
rewrite /index.php last;

## Expires headers
(js | css | png | jpg | jpeg | gif | ico) $ {
expires 30d;
add_header Pragma public;
add_header Cache-Control â "¢ publicà ¢ â,¬Â ??;
try_files $ uri @fallback;
}

Re: Streaming To Wordpress

$
0
0
HI yvilene, maybe this post will help you

https://www.nginx.com/products/streaming-media-delivery/

Re: Streaming To Wordpress

$
0
0
Thanks but at $2500.00 a year for a license for starters? nah lol

How to know if nginx is overload?

$
0
0
Is there a way to see how nginx is performing?
How do i confirm that nginx is overloaded to its maximum?

Re: How to make nginx respect http_proxy and https_proxy

Reverse Proxy 404 not found

$
0
0
I have installed nginx on a hyper-v VM. I am hosting 3 sites. 2 sites on a Win Server VM and 1 site on a Windows 10 VM. The site on the windows 10 VM is working internally but that's only because DNS is routing it correctly. If I try from the outsite world I get 404 error.

Running nginx -t says everything is OK.

I copied my host file from 1, to 2, to 3 and modified it for each site. What am I missing?

Re: Reverse Proxy 404 not found

$
0
0
UPDATE I reversed the configuration for host file 1 and 3. Now the missing domain comes up on the public side but the other 2 domains are being forwarded to that as well instead of their own.

This is obviously a config problem in the hosts file but I'm lost as to what it is.

How to update password or craete new FTP account

$
0
0
Hi there,

I'm a newbie with nginx. Please help me this question.

I don't remember my FPT account so I want to know how to list all FTP account in my server and update one of them?
Or how to create a new ftp account which can access all domains in my server.

Many thanks!

Nginx-same domain different ports

$
0
0
Hi everyone,
I have been playing with Nginx but still unable to see working a "simple" configuration.
I have configured nginx as ssl and for 1 host run perfectly. This is the simple config in available site folder:

server {
listen 443 ssl;
access_log /var/log/nginx/mydomain.com.access.log;
error_log /var/log/nginx/mydomain.com.error.log;
server_name mydomain.com;
location / {
proxy_pass http://192.168.1.1:80/;
proxy_read_timeout 90s;
}
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
}

My problem now is that I would like to add another location, i.e. http://192.168.1.2:80 and not sure how should I do it as the domain and if possible the listen port are the same.
I have been searching but don't see anywhere this configuration an would appreciate if anyone can provide any light on this...

Thanks!

Re: Wordpress in subdirectory

$
0
0
I have this same issue. Have you resolved it? I really want to migrate my site from Apache to nginx but this issue is in the way. Does anyone know a more active forum I can go to for these issues?

Re: Wordpress in subdirectory

$
0
0
I did actually. It came down to my novice understanding of nginx location roots. I’m replying from my phone right now. I’ll post some specifics tomorrow or Monday to hopefully help you out.

Re: Wordpress in subdirectory

$
0
0
Ah, glad to hear that, thank you so much. I am pretty new to nginx and web servers myself. So far though nginx has been easier to set up in general than Apache :)

Exchange-combined shows orange in dashboard

$
0
0
in nginx plus why does exchange-combined show as orange. How can I see why it is not green

HowTo: On Request a PDF-File call an aditional PHP-Script

$
0
0
Hi there,

i've to write addtional informations on a pdf-file-request.
It would be perfect to response the pdf file an call a php script after this.

Is this possible?

Thank you a lot for your help.

PHP-FPM errors to increase start server.

$
0
0
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 52 total children

I am getting this error.

top -c
%Cpu(s): 70.6 us,  8.2 sy,  0.0 ni, 20.8 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st

php-fpm
max_children = 700
pm.start_servers = 30
pm.min_spare_servers = 20
pm.max_spare_servers = 40
pm.max_requests = 2000

nginx
worker_processes auto
worker_connections 15000;
worker_rlimit_nofile 70000;


There is free ram

KiB Mem : 32740464 total, 15831456 free, 1106152 used, 15802856 buff/cache


But i am still hitting the cpu and getting those error messages in error log
Top

WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 52 total children


But it is no use in increasing the pm.start_servers and pm.min/max_spare_servers.
I am getting the problem immediately

If i have 20 start_servers, and max_connection is 2000 can it handle 40,000 connections?
What is max_children?

Force SSL on a specific port

$
0
0
Hi there, just a quick question- I've read several threads that concentrate on forwarding e.g. from 80 (http) to 443 (https), but I'd like to know if there's a possibility to let's say forward http:8082 to http[s]:8082?

Thank you very much in advance for your time!

Redirect/Rewrite

$
0
0
I am trying to redirect the page to a new location.
I am trying to go from http://localhost/page/image_archive.php?i=500
to http://localhost/gallery/500
The $query_string is causing an error. The query_string is i=500. How can I just get the number and not i=500 or whatever number.

location ~* ^/page/image_archive.php?$
{
return 302 http://127.0.0.1/gallery/$query_string;
}

Re: Redirect/Rewrite

$
0
0
FIxed. I added $arg_i instead of $query_string.

Re: Force SSL on a specific port

$
0
0
https is a protocol, the port it uses can be any port, forwarding to https differs in using a certificate and telling the server {} block to use ssl.

Re: Wordpress in subdirectory

$
0
0
Sorry again for the delay. Putting out proverbial fires the past 2 days.

Some background: my site is built on Symfony PHP Framework. I needed to add a blog to /blog/ and decided to go ahead and use wordpress for that piece so that my client can have full creative control there. I had two git repositories for source control and a build process to move from dev to qa to production environments. Almost all of my headaches around making this work can be traced to 1 concept: the location is based off of my main server: www.mysitesdomain.com --- so ~ /blog/ means www.mysitesdomain.com/blog/, AAAANND the location is also used for your location's root. So if your location's root is /var/www/mysite, it's going to look in /blog/ there. If you're wordpress installation is in /var/www/mysite/wordpress, then you need a /blog/ directory in there. I really hope you're having the same kind of issue. Here is my nginx config for just the wordpress piece. Maybe a real nginx expert will see all this and educate us both haha ;)

location ~ /blog/.*\.php(/|$) {
root <the full path to your wordpress installation, one directory up, with no trailing slash. ie: /var/www/mysite/wordpress is what you want here, and wordpress is /var/www/mysite/wordpress/blog/index.php>;
fastcgi_pass 127.0.0.1:9000; #### This is the local host and the port that the php-fpm service is running on
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}

# this is right out of the wordpress codex for static resources
location ~ /blog/.*\.(css|js|jpg|png|gif)$ {
root <the full path to your wordpress installation with no trailing slash. ie: /var/www/mysite/wordpress>;
}

# needed this for admin to work right
location /blog/wp-admin {
root<the full path to your wordpress installation with no trailing slash. ie: /var/www/mysite/wordpress>;
index index.php index.html;
if (!-f $request_filename) {
rewrite ^/blog/wp-admin$ /blog/wp-admin/ last;
}
}

# setting the index here didn't do it for me, so I did try_files and that worked like a charm.
location /blog/ {
root <the full path to your wordpress installation with no trailing slash. ie: /var/www/mysite/wordpress>;
try_files /blog/index.php$is_args$args /index.html;
fastcgi_pass 127.0.0.1:9000; #### This is the local host and the port that the php-fpm service is running on
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
Viewing all 4759 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>