Tag Info

New answers tagged

0

Please check your php file permissions. It should be 644. You can use the following command. chmod 644 *.php Hope this will help you.


0

Turns out the issue was a combination of phpfpm pool status php_flag[display_errors] was on and the lumen application did not have a registered handler for register_shutdown_function (it did have a set_error_handler set). See https://laracasts.com/discuss/channels/lumen/lumen-debug-mode-not-showing-stack-trace for more info


1

I downloaded the theme again from the developer, and I uploaded the theme files to my server, not overwriting existing files, and it fixed it. How my files vanished is truly a mystery.


0

Got it working, the solution was to use $request_filename; instead of $request_filename; location /api/ { alias /var/www/api/; try_files $uri $uri/ /api/index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_pass backend; include /etc/nginx/fastcgi_params; ...


3

First thing, ^~ usage is not necessary if you don't have any regex matching this pattern prior to the location your are defining. What you want to do is basically have proper URIs and rewrite them to pass an argument to your php application. In this case, the appropriate solution is using rewrites. The thing you missed in there is that the URI you are ...


0

Update: so it turns out CORS is a zombified-walking-dead-crazy spec, and yes doing this with an nginx config is the best way. http://enable-cors.org/


0

I've had this error come up few times over last few days I've transitioned content from an old hardware server into AWS EC2 instance. To resolve, I've had to delete the /var/tmp/nginx/fastcgi_temp folder and restart nginx service. This recreates the fastcgi_temp folder and, at least for me, the problem went away after that.


0

You should try to restart nginx after the update of the php.ini You should also make sure that you have modified the php.ini of the web service a not the one for the CLI of php.


1

The problem you are having is that PHP can't write to the /var/lib/php/session directory: PHP message: PHP Warning: session_start(): open(/var/lib/php/session/sess_05tmojugo0peqvoevmlnk4ch36, O_RDWR) failed: Permission denied (13) in /mnt/ext/web/html/panel/include.php on line 52" while reading response header from upstream, client: 92.206.106.243, server: ...


0

Had a similar challenge recently and your location blocks now seem correct: Nginx: Selective On/Off of Auth Basic Based on Realm The persistent flux is probably due to browser caching, which caused me hours of wasted time also on this topic. Whenever you change any http auth settings, close the browser entirely, ideally reset it, then reopen the page and ...


0

The sentence "172.16/12 has not been enabled by default because it is complex to describe with regular expressions" made me cringe when I've read it for the first time. Anyway, you can just copypaste the regexp from the Tomcat 8 documentation for RemoteIpValve. Here is a complete example: <Valve className="org.apache.catalina.valves.RemoteIpValve" ...


0

If you are willing to switch over to hls (nginx-rtmp supports hls) it'd make your life - from my experience - easier than trying to load balance rtmp itself. Once you have hls transcoding set up the only thing you need it to either put a cdn in front of your webserver and let that take care of the caching or roll your own using varnish, squid or even nginx ...


4

When using SSL-Session-Cache, the performance of keep-alive connections over SSL might be enormously increased. When the server does have it enabled, it is not necessary for the client to do a full SSL-handshake every request, thus saving time and cpu-resources. You can read up more here: ...


0

The proxy_params file is not included in the configuration by some sort of default include like I assumed. I've corrected the problem by adding include /etc/nginx/proxy_params to each of my locations using proxy_pass. That "proxy_set_header Host $http_host;" thing is critical. I'd welcome a cleaner solution if anyone has one that allows me to set those in ...


0

What I deduce from your stack trace is: Your web app is contacting an external SMTP server to deliver some mail. The PEAR library sent an RSET command to the SMTP server. The SMTP server did not send a response to the command; it just hung. The big problem I see here is that you only send an RSET command to a mail server if it has already rejected a ...


0

Remove: more_set_headers "Content-Type: text/html;charset=utf-8"; You are set header Content-Type: text/html;charset=utf-8 for all responses


2

See my comment above, and cpburnz's reasoning, but if you really want to proceed: You could write a script which writes just the log commands to an include file, with the current date hard-coded. You'd have that included into your nginx config file, and your script would restart or reload nginx after writing the log commands to the include file. Something ...


2

According to that blog post, Please note, that it’s not possible to embed variables in error_log directives, as any potential error would not be able to be logged if the file cannot be written. With that in mind, it is not possible to have the error log automatically rotated with the naming format error-$year-$month-$day.log using that Nginx method. ...


4

Redundancy, resiliency, scalability and flexibility are factors here. Many environments can and do scale beyond a single server in the web-tier. It also makes sense to understand what the realistic bottleneck of the environment is: CPU? RAM? Network?


1

I think logrotate manual is clear about most of your points. Here are my answers: Using daily causes log rotation to happen every day. So, you need to check why it is not happening on daily basis. For example, this can be caused by the other option notifempty if the log file was empty for few days. I can't find an option to do it every 6 months, but you ...


0

Since you've changed your question completely my original answer (bottom) no longer applies. But one reason that going to https://robert.bob.com/norbert/ goes to backend1 instead of backend2 could be because backend1.bob.com and backend2.bob.com resolve to the same IP on the machine running your nginx proxy. I think this section may also be wrong (I'm not ...


0

You really should redirect to ssl BEFORE the POST. That's the whole point of having ssl there in the first place. Otherwise users are posting their credentials unencrypted! Theoretically instead of the 302 redirect to https, you could serve a 200 OK with some dummy javascript that does a hidden submit onload to repost the form to https, but REALLY TRULY ...


0

as far as I can understand with the information provided: your server's log files are being managed by logrotate daemon (see it as an archive engine for logs) this explains why you see some files in .tar.gz format I bet that those files are the one having as owner root (check here for more information http://linuxcommand.org/man_pages/logrotate8.html). ...


-1

I don't know if nginx supports scalability with rtmp module but if you are free to change the server solution you can try our server : Monaserver. It allows scalability and supports other protocols natively (like RTMFP). You have a configuration example of scalability with 3 servers here : ...


1

You can utilize magic variables group_names and groups to look up groups defined in your inventory: --- - hosts: webservers vars: dcs: [dc_1, dc_2, dc_3] tasks: - debug: msg: | upstream backend { {%- for dc in dcs %} {%- if dc in group_names %} {%- for host in groups[dc+'_appservers'] %} server ...


-2

IMO, if you put your website in Internet instead of Lab, you might see the difference. Imagine an user from another country with low network speed open web browser to access your website. uWSGI will handle that Http connection in a thread. That thread may spend pretty long time to wait for a complete Http request due to low network speed. If your thread ...


1

I think the configuration options you require are: proxy_cache_use_stale updating; proxy_cache_lock on; This serves out of date elements from cache, and issuing updates from backend. So when your backend servers a page after 2 seconds, the client already got the old ressource from cache. The second locks one element from cache, while already a ...


1

You are actually redirecting the client to a different server. Assuming you configured DNS to point to server1, you want to mask the presence of server2. To do this configure apache as a reverse proxy and proxy /forum requests to server2. You do not need to configure SSL on server2.


0

Php-fpm may have run out of child processes when this happens, check in your pool logs for errors. This usually happens if you have long running PHP queries in a high traffic environment.


1

wp-admin is a separate page from index.php so your location directive will never access it. You basically set your location as /WordPress and nest your .php location within it. I'm on a tablet so will add an example code fragment when I get on a desktop/laptop again.


1

From the comments, four things come to my mind. Routing - Are the two nodes in a network that makes it able to connect to each other. Use networking tool such as traceroute, arp, arping to check it (arp to ensure the node is the same). Is there a firewall or security policy in between that blocks the said ports. Is your server running RHEL/CentOS/Fedora ...


1

You might try setting up multiple server instances, each responding to the appropriate server_name and then proxying from each one as follows: server { listen x.x.x.x:400; # your one IP server_name domain1.com; location / { proxy_pass http://192.168.1.1; } } server { listen x.x.x.x:400: # your one IP server_name ...


0

Something like following will work for you: map $http_host $upstream_proxy { default 192.168.1.3; domain1.com 192.168.1.1; domain2.com 192.168.1.2; } server { server_name _; location / { proxy_pass http://$upstream_proxy; } } For more ...


0

From the nginx documentation (http://nginx.org/en/docs/http/server_names.html): When searching for a virtual server by name, if name matches more than one of the specified variants, e.g. both wildcard name and regular expression match, the first matching variant will be chosen, in the following order of precedence: exact name longest wildcard name ...


0

A quote from nginx documentation: If the longest matching prefix location has the “^~” modifier then regular expressions are not checked. So, the problem here is your location ^~ /app definition. The ^ modifier makes nginx ignore the regular expression for the images. You should use location /app instead. You don't need regular expression matching in ...


-1

I guess that problem is "~*", try just with "~". Example: location ~ \.(?:ico|css|js|gif|jpe?g|png)$


0

A small addition to the great answer from Xaviar: If you happen to be not so well acquainted with nginx, there's an important difference between adding the slash to the end of the the proxy_pass directive. The following does not work: location ~* ^/dir/ { rewrite ^/dir/(.*) /$1 break; proxy_pass http://backend/; but this one does: location ~* ...


2

Your location blocks are in the wrong place. They have to be inside a server block. I recommend that you study nginx configuration much more closely, so that you understand the whole concept. Otherwise you will only get problems in the future.


1

In addition to @Bazze's excellent comment regarding libsas, you may be missing a dependency ( or a dependency on the right architecture) Note that it is fairly common to have to install both 32-bit and 64-bit libraries for some applications. If you use ldd /path/to/amazon-elasticache-cluster-client.so, do you see any lines mentioning ‘unresolved’ or ...


0

my five cents on the issue - in our PHP project we have few 404 pages, so I decide to do it on PHP level using PHP header() functions


1

Try this, you have to append your tests so that you can test for "AB". But then, do you really need it in the server configuration? set $test ""; if ($uri ~* "^/page/submit$") { set $test "A"; } if ($request_body = '') { set $test "${test}B"; } if ($test = "AB") { return 403; }


1

I went to regex101.com to test and this regex ^(.*)\/(.*)(_)[0,1](.*)\.(.+)$ matched for string /static/images/00f37ac6291bb6e8_150.jpeg. With this match $1/$2.$5 would be the path to the larger image.


0

The solution I needed was: have different website files placed under different user accounts i.e. home/USER/website instead of all under var/www/. These files should be owned by that user as opposed to www-data or similar. Configure Nginx hosts to point to the new location for each site. Configure PHP to run as a specific user for the sites under that ...


0

In the case where your Nginx and php-fpm containers are on the same host, you can configure a small dnsmasq instance on the host to be used by Nginx container, and run a script to automatically update the DNS record when the container's IP address has changed. I've written a small script to do this (pasted below), which automatically update DNS record which ...


0

The only solution I have found: http://www.techsupportall.com/solved-cannot-access-secure-sites-https-websites-not-opening-view/ There is instruction how to REGSVR to Internet Explorer.


0

I only changed location /get_match to location = /get_match. It worked. I don't get why, though. I thought that the = only shows the EXACT location and stops the parser from searching for other possible matches for the given location. Any comments would be appreciated.


0

Add this block to your first server block: location /masmagazine { alias /var/www/masmagazine; try_files $uri $uri/ /index.php?$args; } The try_files inside the location blocks works relative to the location block root directory, which here is defined using the alias statement.


0

Try somthing like that: upstream teach_backend { server application.impactteachers.com:8080 fail_timeout=2s; keepalive 32; } server { listen 80; server_name your_server_name.com; location /teach { proxy_http_version 1.1; proxy_set_header Connection ""; proxy_set_header X-Forwarded-Host $host; ...


1

You can use an upstream to define multiple backends, as described here: http://stackoverflow.com/questions/5467921/how-to-use-fastcgi-next-upstream-in-nginx You'd also want to have the config updated whenever new backends die/come into service with something like: https://github.com/kelseyhightower/confd


3

This post serves to tell you not to trust your ISP when they repeat "all is ok from their side" for three weeks. I received this error while using Putty. The server's host key does not match the one PuTTY has cached in the registry. It turns out that another client at my ISP accidentally set my IP as their own, so there were two machines connected to one ...



Top 50 recent answers are included