w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

Configure Nginx to use cherrypy framework
You can use uwsgi for serve the cherry application. check this link: http://nileshgr.com/2012/08/27/getting-cherrypy-working-with-uwsgi

Categories : Nginx

How to configure PhpMyAdmin on NGINX (Windows)
server { listen 80; server_name localhost; location / { root C:MHServerwww; index index.php index.html index.htm; } location = / { root C:MHServerwww; index index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root C:MHServerwww; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { root C:MHServerwww; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; in

Categories : C#

How to configure nginx with multiple server
This should be a good lead for you towards the solution: upstream tornado { server 127.0.0.1:8000; server 127.0.0.1:8001; } upstream geoserver{ server 127.0.0.1:8080; server 127.0.0.1:8081; } server { server_name _; listen 80; location = /tornado { proxy_pass http://tornado; } location = /geoserver { proxy_pass http://geoserver; } } Hope it helps!

Categories : Nginx

How to configure Phalcon in the Nginx config file
This is the link to the official phalcon nginx configurations. http://docs.phalconphp.com/en/latest/reference/nginx.html

Categories : PHP

How to configure proxy servers with puppet nginx?
Use nginx::resource::vhost The source of the repo you are using gives a breakdown of the commands you will need to use: https://github.com/puppetlabs/puppetlabs-nginx/blob/master/manifests/resource/vhost.pp

Categories : Nginx

How to correctly configure Nginx for PHP (Yii framework and Zurmo)
I don't think you need the if() statement in your *.php block. In my nginx setups that's all i ever needed: # Process PHP files location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; # Include the standard fastcgi_params file included with nginx include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; }

Categories : PHP

Configure Nginx to serve "/" from a directory already inside root
server{ root /var/www; location = / { root /var/www/home; } location / { } } Reference: http://nginx.org/r/root http://nginx.org/r/location How nginx processes a request Understanding the Nginx Configuration Inheritance Model

Categories : Nginx

How to configure nginx + Unicorn to avoid timeout errors?
Is there a way to handle this kind of problems? Do the job in background. You should have a separate process that gets jobs from queue one by one and processes them. And since it doesn't work with user requests, it can do its job as long as needed. You don't need unicorn for this, just a separate daemon.

Categories : Ruby On Rails

How to configure nginx rules so that if one failed it serve the request using another
http://wiki.nginx.org/HttpCoreModule#try_files try_files is your friend, here you can do the order you want to try files and finaly have the proxypass upstream.

Categories : Nginx

How to configure nginx to try_files first, if not exists follow the request_uri
I never tried this my self before but this is how I would write it location / { # or whatever location you see fit to your requirements try_files $uri.html $uri; # I don't know if the `.` needs to be escaped `$uri.html`, you can try both }

Categories : Nginx

Nginx - configure location regex for all static file in sub alias
try to add rewrite directive in sub location. Just like this: location /site1 { location ~* .(jpg|jpeg|gif|png|css|js|ico|xml|rss|txt)$ { rewrite "^/site1/(.*)$" /$1 break; root /path/to/anothersite1; } proxy_pass apache:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; }

Categories : File

How can I configure nginx and fcgi to call separate executables depending on request-uri
You can do it with nginx and fcgi. The simplest way to do this is, by using spawn-fcgi - First you will need to setup your nginx.conf. Add the following inside the server {} block - location /index { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } location /contact { fastcgi_pass 127.0.0.1:9001; include fastcgi_params; } location /view_post { fastcgi_pass 127.0.0.1:9002; include fastcgi_params; } Restart nginx and then run your apps listening same ports as declared in the nginx.conf. Assuming your programs are in ~/bin/ folder - ~ $ cd bin ~/bin $ spawn-fcgi -p 9000 ./index ~/bin $ spawn-fcgi -p 9001 ./contact ~/bin $ spawn-fcgi -p 9002 ./view_post Now the requests to localhost/index will forward to your index program and its output will go back to ngi

Categories : Nginx

configure nginx to get js and css directly from public folder of node.js express site
A 403 forbidden response may be related to the nginx process don't having permission to read the files. Check that the folder public is recursively readable by the user running nginx and change the permissions if needed: sudo chmod -R 744 /root/pathToNodeJsExpressSiteFolder/public

Categories : Node Js

NGINX / Apache RewriteMap
Check Nginx HTTP Map Module map $uri $new { default http://www.domain.com/home/; /aa http://aa.domain.com/; /bb http://bb.domain.com/; /john http://my.domain.com/users/john/; }

Categories : Apache

Nginx PHP Consistently Slower than Apache 2.2
You have enabled gzip on-the-fly compression in nginx - very expensive operation, so what do you expect? Even worse, you have configured 5th compression level, that make it even slower, slow as hell.

Categories : PHP

Apache mod_rewrite to NginX rewrite help please
This mostly should do the trick, the problem would be on what exactly u want to be passed to index.php server { server_name example.com; root /path/to/www; location / { try_files $uri $uri/ /index.php$request_uri } } server { server_name www.example.com; return 301 example.com; }

Categories : Nginx

Apache style "MutliViews" on nginx with php
In your scenario, the location / is the last processed location setting. Having a try_files on it won't make it past the location ~ ^(.+.php)$ setting (unless it ends with ".php"), therefore not being forwarded to the fastcgi upstream. You might use a named location for that purpose (locations starting with "@"). Here's an example based on your configuration: # real .php files only location ~ ^(.+.php)$ { # try_files is not needed here. The files will be checked at "location /" # try_files $uri =404; # do not split here -- multiviews will be handled by "location @php" # fastcgi_split_path_info ^(.+.php)(/.+)$; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/var/run/php5-fpm.sock;

Categories : PHP

Apache + mod_wsgi vs nginx + gunicorn
Nginx is a really light and easy to use solution and along with gunicorn it allows us to run any wsgi application and scale it easily. Nginx is better at handling requests since it does not spawn a new process for every request unlike Apache. I have written an answer on how to deploy django with nginx for a related question: Deploying Django project with Gunicorn and nginx

Categories : Django

Configure Apache CXF in Geronimo
Go to varconfig directory. Open config.xml file. check "org.apache.geronimo.configs/cxf/3.0.1/car", "org.apache.geronimo.configs/cxf-deployer/3.0.1/car" Set load="true" if it exist. Otherwise, Download and install it. Set GERONIMO_OPTS="-Dorg.apache.geronimo.jaxws.provider=cxf"

Categories : Apache

nginx/plesk, nodejs+apache - rooting
There is Plesk extension which allows to run Node applications. http://ext.plesk.com/packages/28f799af-1ff4-4bb8-9c87-a04f0f23d32e-jxcore-support

Categories : Apache

How do i use Apache for Upload and Nginx for Secure Download
this directive secure_link_secret, has been deprecated as of nginx 0.8.50, see: http://wiki.nginx.org/HttpSecureLinkModule I made a code using the correct directive: server { listen 182; server_name example.com; location / { root /home/fileshare/domains/fileshare4u.com/public_html/files; } location ~^/d/(?P<hash>[^/]+)/(?P<url>.*)$ { secure_link $hash,$arg_e; secure_link_md5 KEY$url$arg_e; if ($secure_link = "") { return 403; } if ($secure_link = "0") { return 403; } rewrite ^ /files/$url last; } location /files/ { alias /tmp/; internal; } } perl hash generate: use Digest::MD5 qw(md5 md5_hex md5_base64); # http://search.cpan.org/~kazuho/MIME-Base6

Categories : Perl

Convert apache htaccess to nginx RewriteEngine
Try this: location / { rewrite ^/playlist/(.+).txt$ /video.php?action=playlist&file=$1 last; rewrite ^/([a-z0-9]{32})/([a-zA-Z0-9/+=]+)/([0-9]{1}).(flv|mp4)$ /video.php?url=$2&base64=1&action=play&sec_hash=$1&quality=$3 last; rewrite ^/([a-zA-Z0-9/+=]+)/([0-9]{1}).(flv|mp4)$" /video.php?url=$1&base64=1&action=play&quality=$2 last; rewrite ^/download/([a-z0-9]{32})/([a-zA-Z0-9/+=]+).(flv|mp4)$ /video.php?url=$2&base64=1&action=download&sec_hash=$1 last; rewrite ^/download/([a-zA-Z0-9/+=]+).(flv|mp4)$ /video.php?url=$1&base64=1&action=download last; rewrite ^/([a-zA-Z0-9/+=]+).jpg$ /video.php?url=$1&base64=1&action=thumb last; }

Categories : Nginx

Nginx(proxy) + Apache: two process listening same port
Your problem is simple, you seem to have both nginx and apache listening on port 80, so nginx finds the port already in use, you need to move apache to another port, like 81 for example, and make nginx listen on 80, because it's the one which is going to receive the http requests and proxy it.

Categories : Linux

Host main domain on Apache and some of the sub-domains on Nginx
A good solution is to continue to run Nginx on port 80, while adding proxy directives to Nginx to serve as a proxy for specific domains that are running on Apache. An example Nginx configuration: server { server_name www.myserver.com; server_name myserver.com; location / { proxy_pass http://127.0.0.1:8000; } } I do this myself, and it works great.

Categories : Apache

nginx frontend server is not redirecting to apache backend
I was having a similar issue with my Nginx setup with my Apache back end, specifically when Apache was issuing a redirect for: /some-location => /some-location/ Nginx was running on port 80, and my back end Apache on port 8000. and port 8000 was being passed onto the client in the 301 redirect. It took a bit of playing, but I was able to get it to work. Here is what I had to do: location / { proxy_pass http://127.0.0.1:8000; proxy_redirect default; proxy_redirect http://$host:8000/ http:/$host/; ... etc .. } Both Nginx and Apache virtual servers are using the same hostname (i.e. mydomain.com)

Categories : Django

Do I need a server written in node.js instead of a regular nginx/Apache?
You can use Apache and Node.js at the same time, on different ports. Let Apache handle HTTP, and use Node.js on other port to handle your chat, or your real time notification system or whatever you want to do with Node.js You don't have to use Node.js to serve HTML if you don't want to do so. In fact it's not a good idea, unless you really expect a benefit (because your server will handle tons if IO or if you have such a small/simple web that you don't need a monster like Apache behind).

Categories : Node Js

Is it possible to configure multiple Apache WSGIAlias'es under same VirtualHost?
Yes you can. Go read: http://blog.dscpl.com.au/2012/10/requests-running-in-wrong-django.html though as take heed about how to set DJANGO_SETTINGS_MODULE. You may be hitting that issue. Do though update your question to say though what URL you are trying to access and whether you are getting an Apache 404 page or a Django one. BTW, both of your Directory blocks are wrong as they use the wrong directory. Are these the actual configs you are using or have you doctored it to protect real values?

Categories : Django

Apache Commons UrlValidator - configure to allow umlaut characters
You must encode the umlaut part before you validate it as: import org.apache.commons.validator.routines.UrlValidator; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class UmlautUrlTest { public static void main(String[] args) { String url = "http://dbpedia.org/resource/"; String umlautPart="São_Paulo"; UrlValidator v= null; try { String s[]={"http", "https"}; v = new UrlValidator(s, UrlValidator.ALLOW_ALL_SCHEMES); String encodedUrl=URLEncoder.encode(umlautPart,"UTF-8"); System.out.println(v.isValid(url+encodedUrl)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Template

Categories : Java

How to configure apache nutch to remove all a tags and it's content?
If you only wanted to tell nutch to not follow the "a" tags you could simply add "a" to the "parser.html.outlinks.ignore_tags" setting. If you want to remove "a" tags and their contents from parsed data, since the current HtmlParser shipped with nutch does not have any setting related to this, I think you should write a nutch plugin and develop a HtmlParseFilter that do your logic.

Categories : Apache

How can I configure Apache HttpClient 4.x to use a specific Websphere SSL alias?
Fundamentally this problem has nothing to do with HttpClient. HttpClient can be configured to establish HTTPS connections using any custom SSLContext or SSLSocketFactory instance. This is basically about how to use JSSE APIs to configure SSLContext in the right way. In your particular case JSSEHelper does all the hard work for you. // JSSE socket factory javax.net.ssl.SSLSocketFactory jssesf = JSSEHelper.getInstance().getSSLSocketFactory(alias, connectionInfo, null); // HC socket factory SSLSocketFactory hcsf = new SSLSocketFactory(jssesf, SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); This will give a connection socket factory that can be registered with the connection manager. HttpClient 4.3 also comes with SSLContextBuilder class which can be used to assemble custom SSL con

Categories : Authentication

Amazon Elastic beanstalk : Use nginx/apache to forward subdomains to subfolders
you can use Configuration File to customize your nginx configuration. Create an .ebextensions directory in the top-level of your source bundle. Create a configuration file, /your_app/.ebextensions/custom.config. Type the following inside the configuration file to configure forward settings. (I have created a gist) files: "/etc/nginx/conf.d/custom.conf" : content: | server { listen 8080; server_name foo.chief-motp.com; location / { proxy_pass http://nodejs/foo/; proxy_set_header Connection ""; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Categories : Htaccess

Configure Apache to avoid cross domain call with Dart
I'm not sure you can do this, your VHost would have to listen on 3030, not 80 as you have above to perform the proxy function which it can't do as Dart is using this port, below is an extract from a Vhost file I use to proxy from Dartium to a CouchDb server to allow a browser based couchdb client access using CORS, this may not be what you want though :- <VirtualHost *:8080> <Proxy http://141.196.22.210:5984> Order deny,allow Allow from all </Proxy> RewriteEngine on RewriteCond %{REQUEST_METHOD} ^OPTIONS Header set Access-Control-Allow-Origin http://127.0.0.1:3030 Header set Access-Control-Allow-Credentials true Header set Access-Control-Allow-Headers Content-Type Header merge Access-Control-Allow-Headers Authorization

Categories : Apache

Howto configure Apache WSGI for multiple separate Django instances?
You may need to set WSGIPythonHome since you have different Django installations. WSGIPythonPath is used to define additional directories, but this option do not set default python installation. So probably, your default python directory also includes django (1.5) and recognize this version as the default django version. I do not know your python and django installation and configuration but this might be the reason. Additional info for WSGIPythonHome

Categories : Python

How to configure Apache Flume to fetch data from Twitter for specific period?
You might want to use customized source for flume. http://blog.cloudera.com/blog/2012/10/analyzing-twitter-data-with-hadoop-part-2-gathering-data-with-flume/ The TwitterSource mentioned in the above link will help you fetch twitter data based on keyword.

Categories : Twitter

How configure Apache HTTP so URL will work without context for three Tomcat 7 Java apps
Name your web applications context1, context2, and context3 in each Tomcat instance and change your httpd.conf mappings to these: JkMount /context1|/* worker1 JkMount /context2|/* worker2 JkMount /context3|/* worker3 If you want users to be able to go to / instead of /context1 then you are going to have to use different VirtualHosts on Apache httpd and configure each webapp to be the ROOT webapp on each Tomcat instance.

Categories : Apache

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

How to configure the virtual host in apache to let the users access those resources with certain file extensions only?
you can set the apache directories by allowing access for images folder and deny the access to the others <virtualhost> Documentroot /var/www Alias /images /path/to/images <Directory "path/to/images"> Options Indexes FollowSymLinks AllowOverride None Allow from all # allow access to images only </Directory> <Directory "path/to/apps"> Options Indexes FollowSymLinks AllowOverride None Deny from all </Directory> </virtualhost>

Categories : Apache

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

How to configure Hadoop MapReduce mapper output compression if I use org.apache.hadoop.mapreduce (new) API?
You can use the following codes to enable the map output compression: public static void enableMapOutputCompress(Job job) { job.getConfiguration().setBoolean("mapred.compress.map.output", true); job.getConfiguration().setClass("mapred.map.output.compression.codec", SnappyCodec.class, CompressionCodec.class); } You can change org.apache.hadoop.io.compress.SnappyCodec to other compression class, for example: org.apache.hadoop.io.compress.GzipCodec, org.apache.hadoop.io.compress.LzoCodec. I suggest to use SnappyCodec.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.