w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
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

Default nginx conf file
I guess, first vhost would be used. If you use including virtual hosts (/etc/nginx/sites-enabled/*) the hosts would be included in alphabetical order. So, if you have hosts "a", "b" and "c", first of them will be "a".

Categories : Nginx

nginx.conf for url routing
You might want to try something like this, works like a charm for me: location / { try_files $uri $uri/ @rules; } location @rules { rewrite ^/(.*)$ /index.php?param=$1; } This looks for the location at / which is your web root. All of your web accessible files are found in this directory. If a file exists, it'll take you to that file. If not, then it'll throw you into the @rules block. You can use regexp matching to vary your url formatting. But in short, the (.*) matches any string in your url and takes you to your index. I modified what you had written slightly to feed the original input in to index.php as a parameter. If you don't do this, your script won't have any info about how to route the request. For example, then going to /blablabla will mask the url but pull u

Categories : PHP

Nginx and Cakephp .conf file
Have you tried this? http://book.cakephp.org/2.0/en/installation/url-rewriting.html#pretty-urls-on-nginx If not try my config files. cakephp2-rewrite-rules.conf if (-f $request_filename) { break; } if (!-f $request_filename) { rewrite ^/(.+)$ /index.php?url=$1 last; break; } cake2app.conf location / { index index.html index.htm index.php; allow all; include cakephp2-rewrite-rules.conf; } include php-fastcgi.conf; vhosts.conf server { root /foo/bar; listen vhost:80; server_name vhost; include vhost/cake2app.conf; } Include the vhosts.conf in your nginx.conf in the http section. include vhost/vhosts.conf;

Categories : Cakephp

Modify the location of php-fpm.conf and php-fpm.d/*.conf?
Certainly, all you have to do is pass the --fpm-config option when starting up FPM /usr/local/sbin/php-fpm --fpm-config <file> You can also specify a specific php.ini path by /usr/local/sbin/php-fpm -c <path> I have mine located in /usr/local/etc/ where I also keep my PEAR and other PHP configurations.

Categories : Misc

nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Skype uses port 80,443 by default, those are EXACTLY the http and https ports. Try shutting down skype and restarting nginx. If you are using the 'desktop version' of Skype you can change this setting by the way of tools>options>advanced>connections > untick use port 80 and 443 as alternatives. If you are using the win8 app, the only option seems to be shutting down skype completely or removing it completely. Someone has to confirm the win8 app though, I use linux.

Categories : PHP

stuck on nginx location directive
The reason is that the location directive matches URI (absolute path of the Request-URI to be more precise), not Host. When you use http://images, your browser sends request like this: GET / HTTP/1.1 Host: images Notice that request URI is /.

Categories : Nginx

(ubuntu) nginx: [emerg] bind() to 0.0.0.0:80 failed (13: permission denied)
the socket API bind() to a port less than 1024, such as 80 as your title mentioned, need root access. here is "Bind to ports less than 1024 without root access" and another easier way is to run nginx as root.

Categories : Nginx

nginx location index directive not working
If you explicitly request /index.html, is it served? If not, you might want to add an explicit root /path/to/root; to your server {} block. Also verify that index.html has the correct permissions. This will help with troubleshooting: It will force a 404 if the root index.html is not found. If that happens, at least you can check the logs to see were it was looking: location = / { index index.html; } Also, be sure to do nginx -s reload when changing the config.

Categories : Nginx

While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Apache CONF: How to add outside directories without showing the location in source
For Apache, you are looking for either Alias or AliasMatch. For PHP, you are looking for include_path

Categories : PHP

Where does Apache install httpd.conf by default?
What you did "wrong" was to not read the documentation, which clearly states: PREFIX must be replaced with the filesystem path under which the server should be installed. If PREFIX is not specified, it defaults to /usr/local/apache2. However, I put "wrong" in quotes because I cannot find anything wrong with those directories. What's so bad about /usr/local?

Categories : Linux

Avoiding Django's 500 error for not allowed host with Nginx
It depends on your default configuration, but from this answer on ServerFault you must define a default vhost in Nginx, otherwise it will use the first one as a default. Basically, your configuration should look like this in order to allow only requests to "mywebsite.com.br" to pass: server { listen 80 default_server; location / { # or show another site return 403 "Forbidden"; } } server { listen 80; server_name mywebsite.com.br; location / { uwsgi_pass unix:/opt/project/run/brmed_web.sock; include uwsgi_params; } } If you need to also serve up other subdomains (www.mywebsite.com.br, etc.) you can set the server_name to ".mywebsite.com.br".

Categories : Django

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

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

Nginx location behave with and without location regex
I'd suggest excluding the assets from the rewrite, you can do that by adding a new location, something like this location /(css|js|images) { root /var/www/www.my-project.com/web; try_files $uri =404; } And for the location issue, you can match exact locations using = location = /www.my-project.com {

Categories : Nginx

Merging two location blocks in nginx
Thanks to @VBart's advise, for multiple locations using the same proxy config, you can refer http://wiki.nginx.org/Pitfalls "Proxy everything" section, an example: server { server_name example.org; root /var/www/site; location / { try_files $uri $uri/ /index.php; } location ~ .php$ { include fastcgi.conf; fastcgi_pass unix:/tmp/php-fpm.sock; } }

Categories : Nginx

nginx location outside document root
Try this: location ~ ^/$ { root /var/www/home; } location ~ ^(?!/$) { root /var/www; } or this: location / { root /var/www; rewrite ^/$ /home/ break; }

Categories : Nginx

nginx, exclude single file from location
You're going to kick yourself when you see the answer. What I want to do here is to exclude one single file called piwik.php as it should receive special treatment in a separate location. Ok, you should set that path as a separate location before your default one. e.g. location ~ ^/stats/piwik.php$ { allow 127.0.0.1; deny all; fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_read_timeout 150; fastcgi_index index.php; include fastcgi_params; } location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_read_timeout 150; fastcgi_index index.php; include fastcgi_params; } As those are both regular expression location blocks, the one listed

Categories : Nginx

location directives confusion in nginx configuration
One of the obvious issues with your configuration is that alias must be used rather than root location /test/ { alias /home/test/; } because, root makes nginx to search for /home/test/test as per your config.

Categories : Nginx

How do I make nginx proxy some urls on a domain to one location and the rest to somewhere else
You can refer to "rewrite" and "proxy_pass" directive in nginx manual and this can be solved easily: location ~* "^/$|^/(a|b|c).*?$" { rewrite "^/(.*)$" /site/$1 break; proxy_pass http://127.0.0.1:8001; ......; // to add any commands you need break; } location / { proxy_pass http://127.0.0.1:8002; ......; // to add any commands you need break; } Because no rewrite directive wrote in server block, Nginx start to match url in location phase. If is is caught by one location (here using the 1st one as example), then enter into rewrite loop. "break" in the end of rewrite means jump out the rewrite loop. Then start dealing with other directives in this location ,here proxy_pass will be dealt with. General process in this case would be: location match --> rew

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 to limit max file size for upload in nginx for special location with fastcgi
Is the URI really and exactly http(s)://example.com/account/personal_info/documents/ in your browser? If so, be more specific in your configuration to make sure nginx applies the correct location block. location = /account/personal_info/documents/ { # ... }

Categories : Nginx

Websocket location mismatch when Safari 5.0 connects via nginx https proxy
Nginx websocket proxy only works for RFC6455 compliant handshakes. The older draft 75/76 handshakes, found in Safari 5 and old versions of chrome can't be proxied through nginx. Some more details here: Nginx: Reverse proxying WebSocket Draft 76

Categories : Nginx

How to disable default nginx site when using Chef and Vagrant?
You can disable any nginx site by name using the nginx_site and its name. The problem you are having is because the nginx_site definition is actually looking for the enable parameter to be set to true or false not the action parameter set to :disabled. To disable the default site add to your recipe: nginx_site 'default' do enable false end This is working for me as of version 1.7.1 of the nginx opscode cookbook. I dont know if this will work with the version provided by community as it appears to be several months old. To get the latest version add to your Berksfile: cookbook 'nginx', git: 'https://github.com/opscode-cookbooks/nginx' Hope that helps :)

Categories : Nginx

nginx reverse_proxy with axis camera - default rewrite not working
Try replacing your proxy_redirect with this line proxy_redirect http://192.168.0.205:80/; http://192.168.0.205:80/camera/; I don't know what your Location header says exactly, but you should get the idea, replace the IP with a hostname or whatever the redirect is trying to take you, you're simply telling nginx to append /camera to whatever redirect the website asks you to do

Categories : Nginx

How to use conf file in php
//Include conf.php in every other pages conf.php <?php try { $dbh = new PDO('mysql:dbname=theaterdb;host=localhost','tiger','tiger'); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } ?> other_page.php <?php include("conf.php"); $q = strtolower(trim($_GET["q"])); $sql = 'SELECT address FROM theater WHERE LOWER(theater_name) = :q'; $sth = $dbh->prepare($sql); $sth->bindValue(':q', $q); $sth->execute(); ?>

Categories : PHP

redmine example conf
I don't understand your question but this might help # These modules must be enabled : passenger <VirtualHost *:80> # ServerName my.domain.name # this is the passenger config RailsEnv production # create a link in /var/lib/redmine/default/passenger to /usr/share/redmine PassengerAppRoot /var/lib/redmine/default/passenger SetEnv X_DEBIAN_SITEID "default" Alias "/plugin_assets/" /var/cache/redmine/default/ plugin_assets/ DocumentRoot /usr/share/redmine/public <Directory "/usr/share/redmine/public"> Order allow,deny Allow from all </Directory> </VirtualHost>

Categories : Apache

Django: Issue with url conf
You get the error because the URL conf has not been loaded yet when the class is defined. Use reverse_lazy instead of reverse. from django.core.urlresolvers import reverse_lazy success_url = reverse_lazy('home_page')

Categories : Django

Mock settings in Web.conf with moq
You are better off if you abstract the config file reading, and inject this abstraction into your class, instead of using directly ConfigurationManager. Then for your tests you can mock the abstraction. Create a IConfigurationReader interface: public interface IConfigurationReader { string GetConfigSetting(string settingName); } The real implementation will use ConfigurationManager, but for tests you can mock IConfigurationReader. It may seem overkill, but it's one time work which can be reused all over your application(s). The added benefit is, that if some day you decide to read configuration settings from somewhere else, you just change the implementation, w/o touching your consumers.

Categories : C#

no conf inside $CATALINA_HOME
Yes catlina home points right but there is no means of a tomcat.conf file in a default and plain vanilla Tomcat installation. You however can find several configuration files in the /conf folder. Details/manuals about those can be found at the Apache Tomcat Configuration Reference. And you should always check your etc directory for configuration files. Hope this helps.

Categories : Apache

sed replace in conf 2 different patterns
It is happening because your first matching regex is: server: 127.0.0.1 And 2nd one is: next_server: 127.0.0.1 As you can see first regex will match both the patterns since server: 127.0.0.1 is found for both cases. Fix: To avoid unwanted matching you need to use word boundaries like this: sed -i.bak 's/(server: )127.0.0.1/1xxx.xxx.xxx.xxx/' /etc/cobbler/settings Note: On OSX you need to use this weird syntax for word boundaries: sed -i.bak 's/[[:<:]](server: )127.0.0.1/1xxx.xxx.xxx.xxx/' /etc/cobbler/settings

Categories : Bash

nodejs configuration httpd.conf
Node.js is just a JS framework with a system API. Technically, you could reimplement Apache HTTP Server in Node.js, mimicking its behaviour and its configuration structure. But would you? I believe you are using Node.js' HTTP module. Look at the docs: there's no way to read configuration from a file. The server is programmatically created using http.createServer. You provide a callback that listens to requests. This callback provides an http.IncomingMessage parameter (first parameter) which contains everything you need. Here's an example: // load the module var http = require('http'); // create the HTTP server var server = http.createServer(function(request, response) { // use the "request" object to know everything about the request console.log('got request!'); // method ('GET'

Categories : Node Js

Redirecting a .txt file to /etc/resolv.conf
Try this: cat yourfile.txt >> target_file ">>" here means append its content to the end of target file. Don't mistake it to ">", which will overwrite the target file except you mean it

Categories : Unix

error in Apache2.conf
oh, this looks easy...i think. You'll see <VirtualHosts> near or at the top of the file /etc/apache2/sites-enabled/example.com (error says line 1). Scroll down through everything. if you do not see </VirtualHosts> (notice the slash), put that in the bottom of the file. Save and close, then restart apache Regarding the "operation not permitted": you may have to use sudo to elevate your privileges (assuming you are on unix, which i think you are). Research how to do this if you don't know.

Categories : Apache

Akka not loading application.conf
Try putting your file into src/main/resources/ - application.conf is not a scala file, so it doesn't belong in src/main/scala/resources which is the folder for the package root.resources scala sources. OK. I see what is the problem now. I don't think there's a loglevel setting NONE. According to the doc there are four settings: # Options: ERROR, WARNING, INFO, DEBUG loglevel = "DEBUG" Try setting it to WARNING. Also, you have typo in loglevel - please note it's not a camelCase name, but all-lower loglevel. Side note - add akka microkernel plugin to your SBT build and add runner that can be launched either with run or re-start action.

Categories : Scala

Hadoop conf to determine num map tasks
You should look at the settings of memory management like io.sort.mb or mapred.cluster.map.memory.mb because heap space errors are generally due to an allocation problem and not to map number. If you want to force your map number you have to consider that some values are used prior to others. For instance mapreduce.input.fileinputformat.split.maxsize if small will generate a huge amount of taks even if you set mapred.tasktracker.map.tasks.maximum to a small value. The dfs.block.size has impact on generated map number only if it is greater than the mapreduce.input.fileinputformat.split.maxsize

Categories : Hadoop

Unable to source .tmux.conf
The problem is that you are trying to run it as a script file when it is a config that should sit in the root of your home directory, tmux will look for a file of that name in that location when you create a new session. If you have a tmux session open you you can reload a config by typing Prefix+B : Then type: source-file ~/.tmux.conf

Categories : Bash

How do I create a .conf file in Mac osx Lion?
Open TextEdit's Preferences, and switch to the Open and Save section. Under the When Saving a File panel, uncheck the Add '.txt' extension to plain text files option.

Categories : Osx

bash sed substitution in httpd.conf
When using sed and file paths, it's easier to avoid the "/" delimiter, else you'll be escaping it everytime. This "picket fence" format makes it terrible to read. Assuming you're trying to replace "DocumentRoot /var/www/html" with "DocumentRoot /usr/share/rt3/html/", try this: sed 's_DocumentRoot /var/www/html_DocumentRoot /usr/share/rt3/html/_' /etc/httpd/conf/httpd.conf Example: ~> echo "DocumentRoot /var/www/html" | sed 's_DocumentRoot /var/www/html_DocumentRoot /usr/share/rt3/html/_' DocumentRoot /usr/share/rt3/html/ ~> EDIT: From your comment, you're wanting to 1) open the file, 2) replace the string, and 3) save changes to the original file. In this case, you can use sed's -i flag (in-place editing). Try this: sed -i 's_DocumentRoot /var/www/html_DocumentRoot /usr/share

Categories : Bash



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