Tag Info

New answers tagged

0

Likely you're looking for ngxtop. Real-time metrics for nginx server ngxtop parses your nginx access log and outputs useful, top-like, metrics of your nginx server. So you can tell what is happening with your server in real-time.


0

This is what I done in my test system and its working fine.Looking at the above output it look like you are using so many version of openssl. Please try to figure which one you are using at the same time remove the one not in use and make sure it will not break the other functionality php test.php done ldd `which php`|grep -i ...


0

You haven't define any redirect directive in nginx. Here the proper config. #here the redirect section. If server doesn't match www.example.com or example.com, it will redirected to http://www.example.com server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name _; return 301 ...


2

You are missing listen directive in file default-ssl.conf. Add listen 443; in this directive server { server_name example.com; return 301 https://www.example.com$request_uri } By default, if you omit this directive, nginx assume that you want listen on port 80. Here the documentation of this default behavior. Edit: Thanks for comment from ...


1

Try this: location ~ ^/Claw/(?<subdir>images|styles|scripts)/ { alias /home/ubuntu/Claw/public/$subdir/; access_log off; expires max; } It seems that nginx doesn't pass variables captured into numbered variables from location directive to inside the block. When the variables are given names, then they work.


2

Part of this is Magento related, another nginx. First the Magento part: you need to make sure you have the base_link_url set correctly for the store view. You should only need index.php in the sneakers directory, with the correct MAGE_RUN_CODE. As for nginx, you are telling it to pass all virtual requests to the root index.php, but all requests for ...


0

This means that the library version number is lower on the shared object. Maybe you have two different openssl libraries on your system. You may have linked with one but php is using the other. Try: $ find / -name libssl.so* and have a look at the versions installed. Also have a look at $ ldd `which nginx` | grep ssl to find the library used by ...


0

You could use alias directive for this. location ~ ^/Claw/(images|styles|scripts)/ { alias /home/ubuntu/Claw/public/$1/; access_log off; expires max; }


-2

You could also try h5ai: http://larsjung.de/h5ai/ They provide a really nice interface for browsing the files.


0

A year late to this reply but ustats module for nginx looks pretty impressive: https://code.google.com/p/ustats/ moved to github https://github.com/0xc0dec/ustats Unfortunately doesn't seem maintained after 1.2 but might still work. Found a maintained fork https://github.com/nginx-modules/ngx_ustats_module 1.7.2 patch still works against 1.7.4 perfectly ...


1

Try to set loglevel to debug in /etc/php5/fpm/php-fpm.conf. That should give you some clues in the error log (path in error_log variable in the same config file). This helped me. The problem on my setup, was that there were conflicting values in the pm.* variables in /etc/php5/fpm/pool.d/www.conf. The only symptom was the exact same as you describe in your ...


-1

I am also facing the same issue that is unable to keep session. Cesar has mentioned that he has resolved the issue with apache but I am getting the same even with apache. Can someone pls help me. I have did the following setup. DNS Configuration subdomain.mydomain.com 10.10.10.10 Proxy configuration in apache at 10.10.10.10 <VirtualHost *:80> ...


1

varnishd - HTTP accelerator daemon, it's not it's job to handle those kind of things, but what you can do is schedule a cron job (using curl, wget, etc) that would trigger hitting pages that you like and Varnish will cache them. curl: [alexus@wcmisdlin02 ~]$ curl --help | grep -- '--silent' -s/--silent Silent mode. Don't output anything ...


2

No, Varnish does not generate requests that re-create its caches. You need to make a manual refresh of the pages in order to get the cache warm.


0

The Best Practice according to Docker principles is to conform to the single-responsibility principle. That is option 1 is the preferred way to go. For the rationale behind this see this interesting article Beside this you can use Docker in the way you think more suitable for your business needs.


0

You should remove the existing nginxTry the following commands (assuming that you are root) apt-get autoremove nginx* apt-get purge nginx* And that should do the trick. For compiling from the source, just grab the source from http://nginx.org/en/download.htmlFor services, I would recommend on using nginx instead of service nginx start and nginx -s stop for ...


1

To create the service nginx start Create a nginx entry in /etc/init.d/ touch /etc/init.d/nginx Place your nginx service configuration in /etc/init.d/nginx Example configuration https://gist.github.com/j0hnb/37416fe362e20c82c295 Enable execute rights sudo chmod +x /etc/init.d/nginx That should allow you to run Service nginx start Other service options ...


-3

I think you should find this article quite useful. For further references, you can just run apt-get remove <package> or aptitude remove <package> to uninstall any package but it won't hurt to look for leftovers on the usual places - namely /etc/ - given that you edit those files and apt/aptitude may be reluctant to remove -- unless you specify ...


0

Because the number and the permalink is dynamic, here the proposed solution location ~* ^/(((?!/).)+)-(\d+)\.html$ { return 301 $scheme://$host/$3/$1-$3.html; } For redirect, you can use return instead rewrite. For explanation the regex scheme, please refer this site.


1

The problem with your configuration is that you are only setting the paths to access the PHP files, and nginx still tries to access static resources via the directory specified in root directive. alias is the directive that should be used when you want to serve some URI from a different directory. This should be a proper configuration for your needs. ...


0

Test this one out: rewrite ^/?permalink-(\d+).html http://domain.com/$1/permalink-$1.html permanent;


1

If it is fine that all pages are purged at the same time, then you can do a simple cronjob which empties nginx cache directory. For more fine-grained purging, you can use ngx_cache_purge module, and then set up a configuration that allows to purge files via specific URL calls made to the nginx server. Then you would set up cron jobs making those calls to ...


1

If only need to whitelist by user agent (not IP or other conditions) and don't want to recompile Nginx just to include the auth_request module you can also use the map directive to check the user agent and conditionally disable basic auth. map $http_user_agent $auth_type { default "Restricted"; ~^Mozilla "off"; } server { location / { ...


1

You are confusing the share directory for php and the php binary. The file you should use probably is /usr/bin/php. The path for your script is probably wrong too, as @jin-pow told you. You may have to use /var/www/whatever/foo.php. And if you run it passing ?query=1, it will not work, as PHP will complain that he will not be able to find the script. And ...


1

One way to do this is to use PHP's $argv array that is available in CLI scripts. Example cron: * * * * * * /var/www/mysite/folder/foo.php 1 In your php file $argv variable will be available where $argv[1] (Second element) will be the supplied argument. So if you can modify this scrip to work with $argv, then this is a good solution. If you HAVE to use a ...


0

Owww man i just answered it myself. wget was not working with url because it is an onion site, so it said host not found/reachable whatever. wget was not working via /var/www/...... because it said Scheme missing. Issue was resolved by using the server IP:Port instead of the URL. My cron job is working fine now. Can somebody just tell me if it's ok to ...


0

I figured out what the problem was in my setup. As stated in the question, as soon as the requests have been redirected from HAProxy, nginx didn't map them to the defined WSGI container, but tried serving a static file instead. It turned out that this behaviour was the consequence of the server_name nginx-server-int-01.domain.com; directive in my nginx ...


1

Instead of returning 404 directly rather use: error_page 404 /404.html; location / { try_files $uri =404; } This would produce 404 http status code with custom 404 error page. Hope this helps.


0

I wrote emails to AWS technical support and they responded that currently ELB does not support such configuration at this point.


2

You should learn how Nginx handle location. See this old wiki or new one or this blog. The summary: There are 4 types of location rule, and are applied with the following priorities: Exact matches: There can be only one exact match – the clue is in the name!. For example: location = /foo/bar High priority prefix: There can be more than ...


3

With three rules you can match the example cases and following versions of the widgets: rewrite ^\/widget\/(v\d+)\/?(\?act=)?(.*)$ /widget/$1.php?act=$2 last; rewrite ^\/widget\/?$ /widget/index.php last; rewrite ^\/widget\/?(\?act=)?(.*) /widget/index.php?act=$2 last; I have written these using a online regexp tester but did not setup a test environment ...


0

There is no simple answer to this question. A single memory figure is hard to put onto a running PHP-FPM process. First of all, memory usage of one process is usually divided into multiple parts (usually shared and unshared memory). The usage of shared memory is greatly dependent on the usage of the libraries in PHP. If the guidance you need is to optimize ...


1

server { listen x.x.x.x:80; server_name domain.tld; server_name www.domian.tld; server_name ipv4.domain.tld; rewrite ^ https://$server_name$request_uri? permanent; } This works better i think. x.x.x.x refers to your server's IP. If you are working with Plesk 12, you can do that by changing the "nginx.conf" file in the directory ...


0

Some of your backend server processes have terminated, that is the reason for the 502 errors. You should study why your backend processes die, and fix the problem.


2

The nginx executable file is probably not in your PATH environment variable. This variable is used by your shell to determine where executable files are located and executing the first if a match is found. Your init.d script gives a hint to the location of the executable: /usr/local/nginx/sbin/nginx. To get the version of nginx execute: ...


0

Yes, this works fine. I am assuming that you are using Debian or Debian derived Linux distribution. Then you cannot put sharedconf.conf into /etc/nginx/sites-enabled nor into /etc/nginx/conf.d, since files in those directories are included in main nginx.conf on Debian.


0

If this is the only server block that listens to port 443, it is used for all SSL connections to the server, independent of the actual domain name. You need to make a server block with listen 443 ssl default_server entry to make a virtual host that is served when no other server block matches.


0

Because I was compiling based on the current servers configuration using nginx -V, the output wasn't displaying a sbin path so I forgot about it even thought the compile should have set a default as per the docs. Basically, the folders were not compiled :P --sbin-path=path — sets the name of an nginx executable file. This name is used only during ...


0

I found a solution (at least temporary) in @rcomblen answer: http://stackoverflow.com/questions/16213982/unable-to-find-plugins-in-list-of-available-plugins-in-jenkins It has you manually download the plugin list and post it to jenkins. I think the problem may have to do with my vpn. The vpn isn't setup that well and doesn't let you connect to the ...


1

About first part of your question: Update your regular expression. I think you don't need parenthesis in case you have only one extension: location ~* ^.+\.js$ { proxy_pass http://127.0.0.1:8188/filter?source=$1; proxy_redirect off; proxy_buffering off; }


0

You can use regex in server_name in order to get the TLD in a variable: server_name ~(www\.)?domain\.(?<tld>\w+)$; Now you can use it: rewrite ^(.*)$ /$tld/$1;


0

You are doing explicit return(lookup) in your first vcl_recv. This means that the code in the second vcl_recv block will only ever be run if the request doesn't hit any of the conditions in the first block (i.e., if it's not ^(((www\.|old\.)?domain1\.net)|((www\.)?domain(2\.net|3\.com|4\.org))$) and all the other parts of the second vcl_recv if blocks ...


0

First - you have two vcl_recv functions, you need to combine those into one. But that's just related to blocking cookies sent to the server; seems like sending cookies to the client is where your problem is if an existing session stays working. Do a test login without Varnish; when's the Set-Cookie being sent by the server? Find where that happens, then ...


0

I had the same problem and I finally solved it by using two levels of proxy. Here is how you could do for your situation (I think): server { listen 8001 default_server; server_name web1.example.com; location / { proxy_pass http://web1.local:80; ...


0

* It has some [serious limitations][1], chief among them that it uses [select()][2] for connection processing, and only runs a single thread in a single process. This means that, while it technically can accept() 1024 simultaneous connections, it can only do actual work for one request at a time. * If you repeat it often enough you start to ...


1

As Alexey Ten said, root inside location is bad because you must define root parameter inside every location directive. And if forget to add the root in one of your location, nginx will set root to default /etc/nginx/html Instead you must define root outside your location, e.g. in server directive. You can always add root in your location whenever your root ...


0

I think your nginx setting is good, maybe you can try to restart your jenkins. $ sudo /etc/init.d/jenkins restart And this is my jenkins site conf of Nginx. $ sudo vi /etc/nginx/sites-enabled/jenkins server { listen *:80; [...] location / { proxy_pass http://127.0.0.1:8080/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header ...


0

You shouldn't use root directive inside location blocks. Try this: location /develop/auth { alias C:/webapps/develop/mil_catele_auth/public; try_files $uri $uri/ /index.php$is_args$args; } With this configuration, URLs work like this: http://example.com/develop/auth/image.png -> C:/webapps/develop/mil_catele_auth/public/image.png If you use ...


0

Thanks to masegaloeh for the following solution: The solution is adding php-fpm section like this: server { listen 8081; server_name example.com www.example.com; root /usr/share/phpmyadmin; location / { auth_basic "Restricted Area"; auth_basic_user_file htpasswd; include /etc/nginx/fastcgi_params; fastcgi_pass ...


1

Let me translate the current config. Whenever browser request /wp-login.php, the request only matches section location ^~ /wp-login.php, not including your php-fpm configuration. So, nginx just apply the auth_basic and then spit out the source code of wp-login.php because nginx can't parses it. The solution is adding php-fpm section like this include ...



Top 50 recent answers are included