Tag Info

New answers tagged

0

In your config you have two location blocks \.php$ This is most probably the culprit, combine them in one and you should be fine. Sometimes staring long time at code/config files makes your mind misses something obvious.


0

If you already changed you site URL, as you stated in the other question, you can try with alias location, inside the existing server block. It should look something like this location ^~ /blog { root /var/www/example.com; index index.php index.html index.htm; try_files $uri $uri/ /blog/index.php?$args; location ~ \.php { fastcgi_split_path_info ...


0

You can't put sockets for interprocess communication in /tmp. RHEL/CentOS 7, Fedora, etc., use private /tmp directories, meaning each daemon configured for it (in this case, at least nginx) has a completely different view of /tmp than any other. To resolve the problem, either place the socket in another directory or use TCP connections. And don't blindly ...


1

This is happening because your daemon is only listening on IPv4. IPv6 is the default protocol, so if a given hostname has both IPv4 and IPv6 addresses, the IPv6 address is always tried first. In your case, localhost has the IPv4 address 127.0.0.1 and the IPv6 address ::1. But your daemon is only listening on 127.0.0.1. So, when nc tries to connect to ...


0

Try this way: location /webinterface/ { rewrite ^/webinterface/(.*)/(.*)$ /webinterface/index.php?page=$1&name=$2 ; } You can check is everything fine with your rewrite rule with curl: curl -s -D - -o /dev/null domain.de/webinterface/user/Niklas | grep Location


0

If I understand the question correctly, you want to automatically serve, without using a 301 redirect, http://example.com/foo/index.html when the request is for http://example.com/foo with no trailing slash? If so I've found this try_files configuration to work: try_files $uri $uri/index.html $uri/ =404; The first $uri matches the uri exactly The second ...


0

You can also use Azure Files Storage for sharing configuration. It is SMB as a Service and it is possible to mount it on many VMs in Your virtual network. You can change files on share with REST API (it is CRUD). It is much simpler in implementation than Ansible, but Ansible is better for overall administration tasks.


0

As far as I know, the time you can see in the log is the time when the request arrived at the server. The reason why you don't see the requests in the correct order is that you typically also log information which is only known once the request is processed (return status, response length etc.). I see two options: change your parser sort the input before ...


0

Try to change root for cacto location, I guess using alias is the root cause of your 404, since $document_root refers to root. I'm sure error_log holds more clues.


1

Remove http:// from server_name config New config will be something like this server { listen 80; server_name hg.rawdatatech.com; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /static/ { alias /home/home-garden/staticfiles/; } }


2

Don't use a separate location. In your configuration there are no fastcgi directives to handle the case where the user is not a bad_user, thus nginx treats it as a static file and serves it directly. Instead, put the check in your existing location ~ \.php$ block, and then check for login.php there. For example: location ~ \.php$ { if ($bad_user) { ...


0

I'm no expert, but this page suggests adding alias <PATH_TO>/redmine/public; try_files $uri/index.html $uri.html $uri @app; to your location block. Does that help any?


0

Some ideas to try, based on my own recent similar tuning experiences. With references: You say it's a static text file. Just in case there's any upstream processing going on, apparently domain sockets improve TCP throughput over a TC port based connection: https://rtcamp.com/tutorials/php/fpm-sysctl-tweaking/ ...


2

systemd logs all messages (startup/stop) to /var/log/message using syslog, the errors line you see are basically all matching lines for "nginx" with tail option. Its something =~ grep nginx | tail which will display the last 10 lines of the /var/log/message for "nginx" grep. Basically systemctl displays last 10 lines from log to help user identify the ...


0

This difference is probably not due to nginx, but more likely to your TCP stack (either on the client or on the server). The most obvious difference is that by using 10 simultaneous connections, you will use up to 10 times as much memory for TCP buffers than with a single connection. This also means that by increasing the buffer size you have a good chance ...


1

Nginx by default will output a combined log format (NCSA). GoAccess will automatically recognize it if you pick the first option from the configuration dialog (or permanently uncomment the NCSA Combined Log Format from your config file.) If you are interested to log the request time, then you need to modify your nginx config file and add your custom log ...


0

Okay, one good guy helped me with that. Here's the working config: location /v2 { alias /home/example/api/v2/web; try_files $uri $uri/ /v2/index.php; location ~* \.(js|css|less|png|jpg|jpeg|gif|ico|woff|ttf|svg|tpl)$ { root /home/example/api/v2/web; expires 24h; access_log off; } ...


1

GoAccess says right on their page: Apache/Nginx Common/Combined + VHosts If your logs aren't parsing, then you'll need to look into the GoAccess logs and see what is wrong. Additionally: GoAccess allows any custom log format string. So you may need to look into how to instruct the tool on your custom format.


0

The only suggestion that could be given is that you must, (1), ensure you clear the cache within your browser, and, (2), ensure that add_header is present at the appropriate level. There's not much point in defining it everywhere. If all your fonts are served from within location /fonts, then that's the only location where you must declare the appropriate ...


1

The init script, and specifically the helper start-stop-daemon, expects the program it starts to put itself in the background by default. However, someone has mistakenly altered your nginx configuration to prevent it from doing this: # Keeps the logs free of messages about not being able to bind(). daemon off; This section should be removed entirely. ...


0

The problem is that IE8 and older on Windows XP does not support SNI. If you need to support users on Win XP/IE 8, each site needs its own dedicated IP address and corresponding SSL certificate.


0

Solved it :) When I installed HHVM I ran the below shell script which set HHVM and changed some configurations. sudo /usr/share/hhvm/install_fastcgi.sh I'm not sure exactly what this did but I'm almost certain it is what caused the issue as when I ran the below uninstall script which also comes with HHVM it fixed everything and now Apache works also. $ ...


2

I believe what you are experiencing is consistent with how SPDY works. In 'old' HTTPS, the browser will send requests to the server in a serial manner, which is what you're seeing in your first screenshot. With SPDY, however, all requests are sent simultaneously, after which the server responds with the files in the order it deems optimal. This is what ...


0

1). As a rule those crawlers find something like "admin.php" - You may collect Your own base of urls ;) and block them. 2). If You have good understanding what web applications works on Your server and which files it uses - You may deny access to all php-files - they are the most popular target of crawlers. And explicitly allow only for Your files. ...


1

Your nginx configuration isn't good at all. Try something like this: listen 80; listen [::]:80 default_server ipv6only=on; root /home/website/www; index index.php index.html index.htm; server_name example.com; error_page 404 /home/website/error/index.php?er=404; location / { rewrite ^view/execute(.*)$ /home/website/view/execute.php?a=$1; ...


0

ive seen this many times, why to keep multiple shops in separate subfolders, isnt it a subdomain work?? the correct way is to keep your shop as is, and using dropdown menu select your store view, and change base url.... then in nginx you maybe need to use map configuration, map $request_uri $mage_code { default edu_default; ...


1

You might have php5-fpm listening on a unix socket (like /var/run/php5-fpm.sock, while Apache tries to connect to 127.0.0.1:9000. Check the listen-directive in your php5-fpm configuration (I'm guessing /etc/php5/fpm/pool.d/www.conf). And then either configure Apache to use the unix socket or reconfigure both php5-fpm and nginx to use network sockets (a ...


0

This happens when some library is missing. As I see this is kind of an try and error situation. e.g:You need to install PCRE libraries for Nginx to compile. Try this: apt-get install libpcre3 libpcre3-dev apt-get install openssl apt-get install libssl-dev If it doesnt work, something else is missing...like in my case. Edit: also make sure you got zlib ...


0

other operating system than Windows XP are working good, but Windows XP is still recognizing a wrong certificate.. In this case your setup requires Server Name Indication (SNI) and somewhere you have configured another certificate for clients not able to do SNI, like MSIE8 on XP.


0

It isn't removing all of your whitespace. It is reducing each chunk of whitespace to a single space. For most of your nginx.conf this won't hurt anything. If you have quoted strings with multiple spaces those will get changed too by the command above. You can check for that easily by greping for quotes in the template. Rather than tweaking echo to ...


1

Finally I find out the walkaround, resolve the domain insdie location works! example: server { listen 9000; server_name example1.example.com; location / { set $target http://something.service.lab.mu; proxy_pass http://$target; } } And nginx won't try to resolve http://something.service.lab.mu at start time.


2

I will start this answer as a kind of open-answer. As I can not answer it all at once and there will be follow-up questions. First thing is - you are kind of overcomplicating things. Serving static content through nginx, varnish and haproxy will probably cause a lot of unnecessary overhead (more TCP connections, more content switches, more memory used, ...


0

Maybe you are interested in keepalive_requests ? The default value is 100, you can change it to a higher value


-1

Similar situation: https://github.com/facebook/hhvm/issues/5081 Let me know if you find some way


0

I found this answer from a different question and it solved my problem. It's worth noting though, it required updating to the latest version of nginx. It is mentioned in the comments but it is not immediately obvious.


4

Change the backend server specification to this: server server1 backend:3000 weight 1 maxconn 8192 check ssl verify none The "ssl" part defines that the backend speaks SSL, if it is not present, haproxy will default to plain HTTP. The "verify none" disables certificate check, something you probably don't want to do with your internal servers anyway.


0

This location = / { proxy_pass http://SIPREPWWPRESS03.simosa.inet/; } Should be location / { proxy_pass http://SIPREPWWPRESS03.simosa.inet/; } As per http://wiki.nginx.org/HttpCoreModule#location location = / { # matches the query / only. [ configuration A ] } location / { # matches any query, since all queries begin with ...


0

My framework is laravel and according to their docs, http://laravel.com/docs/5.0 This worked for me: try_files $uri $uri/ /index.php?$query_string;


1

TL;DR - the fix (which you may not even need) is VERY SIMPLE and at the end of this answer. I'll try to address your specific questions, but your misunderstanding of what PATH_INFO is makes the questions themselves a little bit wrong. First question should be "What is this path info business?" Path info is stuff after the script in a URI (should start ...


1

The surest way to deal with this situation is to guarantee that a site will only be served if that hostname is specifically requested. The only situation where one site can be served when another is requested is when Nginx cannot (for some reason) find the site requested and instead serves the default. The default will either be the first server defined or ...


0

The trailing slashes rewrite is done line this: rewrite ^(.*)/$ /$1 permanent; Front controller is done like this: try_files $uri $uri/ index.php;


3

You are using different format for the listen directives in the ´server` blocks. This means that the virtual hosts get different listening sockets for themselves, and for some protocol / interface combinations, you might get unexpected result for the request. I would recommend you to use listen 80; on both virtual hosts, so that nginx will listen to port 80 ...


0

I just wanted to expand on heiko's answer, you should include request_url in the redirect. server { listen 80; server_name .oldsite.com; if ($host ~ ^(\w+)\.oldsite\.com$) { return 301 https://$1.newsite.com$request_uri; } return 404; }


0

Based on the log you provided from Nginx, it seems that the connections between your server and users are unstable or slow. Please try traceroute to your client IP address or his/her gateway from your server. Also, ping your client IP address for a long time to see the packet loss rate and response time. MTU may be another source of this problem. Test if you ...


0

I can confirm that the headers_more module (mentioned in this answer) can be used to add headers for all HTTP responses, regardless of status code. Note: You may need the workaround at https://github.com/openresty/headers-more-nginx-module/issues/24 to build this module with Nginx on Windows, but it works as expected once compiled in.


0

So it turns out that ab benchmark did not correctly execute the HTTPS test correctly. When running ab via HTTPS internally (through nginx) with no reverse proxy I was able to yield 7000 req/s, but as soon as proxy was enabled the req dropped to 160/s. It turns out that ab's keepalive feature does not work with HTTPS+Reverse proxy, must be a bug. I ...


0

In the Nginx wiki as security measure if (!-f $document_root$fastcgi_script_name) { return 404; } is included in the location block. In other tutorials try_files $uri =404; is used, which should do the same, but can gives problems according to the Nginx wiki. With these options, cgi.fix_pathinfo=1 should not be a problem anymore. More infomation ...


0

I know this is an old question that's already been answered. But I wanted to comment here for @harryg and others that come after me. Your issue was with restarting php5-fpm being buggy. As of this writing, the issue seems to have been fixed, and restarting php5-fpm on ubuntu is as simple as running the following command: service php5-fpm restart NOTE: ...


2

After @AD7six suggestion, I changed the nginx config file's last line from server unix:/var/run/php5-fpm.sock; to fastcgi_pass unix:/var/run/php5-fpm.sock; and now my site is up and running via https.


1

Assuming you want your whole site to run SSL you have to 301 your http traffic to https like so: server { listen 80; server_name www.example.com example.com; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; server_name www.example.com; [... SSL Server Stuff ...



Top 50 recent answers are included