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

Nginx as reverse-proxy: serving files without extension
The problem is, that you need something to identify the files without any extension. A sub-directory or something that’s always present within the request. Your regular expression only matched for requests that start end end with a dot (e.g. http://example.com/.). The following server configuration assumes that all URLs start with storage, as this would be the only possibility to identify those files. Please note that I’m using the try_files directive to rewrite the internal path where nginx should look for the file. The root directive is not meant for what you want to achieve. And last but not least, you should always nest location blocks with regular expressions. There is no limit in the nesting level. nginx will create some kind of tree data structure to search for the best matchi

Categories : Nginx

nginx reverse proxy to access a backend webcam server that requires 2 ports for the URL
You can use this configuration file Proxy pass server for your first port server { listen 80; server_name localhost; #ssl configuration begin ssl on; ssl_certificate /usr/local/nginx/conf/cert.pem; ssl_certificate_key /usr/local/nginx/conf/cert.key; keepalive_timeout 70; #ssl configuration end #proxy pass proxy_pass http://192.168.1.7:70/url$request_uri;//70 is your first port proxy_set_header X-Real-IP $remote_addr; proxy_set_header Request_Uri_X $request_uri; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } Proxy pass server for your second port server { listen 81; server_name localhost; #ssl configuration begin ssl on; ssl_certificate

Categories : Nginx

Gitlab 5.3 behind nginx reverse proxy
Assuming that the git daemon and the nginx daemon are on the same box I believe that the location block should be like the following: location ^~ /git/ { proxy_pass http://127.0.0.1/git; proxy_redirect http://127.0.0.1/git/ /git; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }

Categories : Nginx

nginx websocket reverse proxy configuration
This issue is related with the nginx version. Pleas check nginx -v, to check your version. The followings params are supported after the 1.4 version. # WebSocket support (nginx 1.4) proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; If you are using ubuntu you can install a newer version with this steps: First remove the old version (http://askubuntu.com/questions/235347/what-is-the-best-way-to-uninstall-nginx): sudo apt-get remove nginx sudo apt-get purge nginx sudo apt-get autoremove Then install a new version (https://launchpad.net/~nginx/+archive/development): sudo add-apt-repository ppa:nginx/development sudo apt-get update sudo apt-get install nginx

Categories : Nginx

When using NginX as a reverse proxy, how can i fallback to a maintenance url?
are you using the free version ? I think what you are looking for is in the non-free version called NGINX Plus. Advanced Load Balancing Application Health Checks

Categories : Nginx

Find and Replace with Nginx Reverse Proxy setup
It's not ideal, as really the source should be rewritten, but you can use sub_filter to rewrite the content of responses for proxied requests. With your example this would be: location /something { ... sub_filter '(111) 123-4567' '(222) 765-321'; sub_filter_once off; } The default behaviour of this is to replace once (which I have disabled in the example) and to only apply the changes to html pages (this is based on the mime type of the response). This is suitable for using in a reverse proxy as it can replace the Location header with the default options, and links when you disable the sub_filter_once option. While this module is not available unless explicitly configured at compile time, it is my experience that any package manager installed nginx has this option enabled.

Categories : Search

Nginx: Response handling and Reverse Proxy with Cache
Actually, location.capture is not designed to do things you doing, but, if I get you correct (you want to send headers that browser send you to subrequest) you, probably, can hack it around using ngx.ctx + set ;) But I'd say it is a very dirty kludgy way.

Categories : Nginx

Extract port number from URL and reverse proxy with Nginx
This may be helpful: server { listen 80; server_name test1.test.com; location ~ ^/app/(.*)$ { proxy_pass http://192.168.154.102:$1; } } Notice: If you visit test1.test.com/app/8081, nginx will pass the request to http://192.168.154.102:8081/app/8081. More information about proxy_pass

Categories : Nginx

NGINX Reverse Proxy for upstream Django/Gunicorn Backend
Proxy Buffering Generally proxy buffering is only going to help you if you're generating very big web pages, or sending large files. regardless, it's pretty easy to set up, but you will need to tune the buffer sizes to about the size of your largest pages +20% (Any page that doesnt fit in the buffer gets written to disk), or selectively enable proxy buffering on your largest pages. docs: http://wiki.nginx.org/HttpProxyModule#proxy_buffering Caching I don't know much about your app and how dynamic it's content is, but setting up correct Cache Control/ETAG header generation on your app will be the first thing you'll want to look at. This is what will let Nginx know what is safe to proxy. Also, you may wish to setup multiple cache zones to manage the amount of space your caches take on di

Categories : Django

How to use reverse proxy on apache for a specific url?
Apache's ProxyPass directive seems to do what you're asking for. You could do something like this in server B configuration: ProxyPass /search http://server-A.example.com

Categories : Ruby On Rails

How to properly setup nginx as a reverse proxy for gunicorn and flask using subdomains, for both SSL and non-SSL configurations?
server { listen 80 default_server deferred; listen 443 default_server deferred ssl; listen [::]:80 ipv6only=on default_server deferred; listen [::]:443 ipv6only=on default_server deferred ssl; server_name example.com www.example.com testing.example.com; root /path/to/static/files # Include SSL stuff location / { location ~* .(css|gif|ico|jpe?g|js[on]?p?|png|svg|txt|xml)$ { access_log off; add_header Cache-Control "public"; add_header Pragma "public"; expires 365d; log_not_found off; tcp_nodelay off; open_file_cache max

Categories : Python

infinite timeout for reverse proxy in Apache
I experienced a similar issue with Nginx and solved it the same way as you did. But I changed the timeout to 1 day as it was sufficiently large in my case. I think you cannot do away with this. The rationale behind this is that Apache (or any proxy server for that matter) has to maintain its performance, which it clearly can't if it has to hold stale or inactive connections. You'd rather let your proxy server proxy more active connections than inactive connections. Therefore, there is no way to turn off the ProxyTimeout in Apache or even in Nginx (configured using proxy_read_timeout). So if your proxied server is not sending any response within the timeout, then either your application server is taking too long to respond or there is something wrong with your application server or the cl

Categories : Apache

My Apache Reverse Proxy is not returning the correct URL when using ProxyPass
Solved: #REDIRECT for http://sysaid.external.com <VirtualHost *:80> ServerName sysaid.external.com ProxyPreserveHost On Redirect / https://sysaid.external.com </VirtualHost> #https://sysaid.external.com <VirtualHost *:443> ServerAdmin webmaster@external.com ServerName sysaid.external.com SSLEngine on SSLCertificateFile /usr/local/etc/apache22/ssl/webmail.external.com.crt SSLCertificateKeyFile /usr/local/etc/apache22/ssl/webmail.external.com.key ProxyPreserveHost On ProxyPass / http://srv-01.internal.local/ ProxyPassReverse / http://srv-01.internal.local/ ProxyPassReverse / http://sysaid.external.com/ </VirtualHost>

Categories : Apache

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

Handling authentication with Apache reverse proxy for plack/PSGI app
Apache's mod_session looks to be the component you are missing. Since the proxy is the gateway to the applications in the back-end, it can handle the authentication on the HTTP layer and pass back sessions as needed to the Perl script using the proxy entry. Exposing the user information to the Perl application can happen in a few ways. mod_session_dbd - is a module to store session information in a database. This could then be shared with the back-end server hosting the Perl application. mod_session_cookie - is a module to store session information in a cookie on the browser of the client. Session variables would be stored in the cookie and the Perl application would retrieve them. But, cookies or putting session variables in the URL open up security concerns. Cookies and headers

Categories : Perl

Apache Reverse Proxy and Google Authenticator as 2-Factor Auth
By "real two factor" you mean you want the username, password and token - not just username and token, right? So, here's one option - it's possible to configure PAM on linux to require a password which is the concatenation of password and code. See: http://google-authenticator.googlecode.com/git/libpam/README Then you can use apache auth via PAM (http://pam.sourceforge.net/mod_auth_pam/configure.html) as the authn for your apache reverse proxy and voila. Now, I have not actually tried this, and it's possible that it will attempt to verify the password every time (so you'll be logged in for exactly one request before the code becomes invalid!), so then you'll want to use mod_auth_pam combined with mod_auth_form which allows you to set a session cookie to bypass the password checking whil

Categories : Apache

Apache reverse proxy with digest auth prevents stylesheets from Amazon S3
My guess is that your proxy is sending the Authorization header to S3 and S3 responds with that error. This is because S3 uses the same Authorization header to authorize API requests and it does not support basic or digest authentication on it's own. Do a test towards a local backend and verify what request headers are being sent by the proxy. If the Authorization header is indeed present, rewrite the request on the proxy to remove it before it's sent to the S3 backend.

Categories : Apache

Apache reverse proxy to https site gives (70014)End of file found:
If I understand your question right - your communication route looks like this Browser Apache backend server In this case, you must remove the ProxyRemote directive - because it's only needed if you communicate via another proxy with the backend server.

Categories : Apache

How to use nginx as reverse proxy to direct localhost:9292 to a sub domain foo.localhost/?
If foo.localhost is your sub domain name and you want to proxy pass sub-domain to main-domain, you can use proxy_pass and you can learn a little more about server directive if needed. An example: server { listem 8080; host sub.main.com; ... location / { proxy_pass http://main.com; break; } } server { listen 8081; host main.com; ... location / { //do something } } This is proxy pass, means when access sub.main.com, actually it finally dealt by main.com, but the client side still shows sub.main.com. If you want client side shows main.com, here should use redirect but not proxy_pass.

Categories : Nginx

Apache 403 Forbidden When Uploading Files
Apaches module mod_security has a 60kb upload limit by default so any bigger upload will throw a 403 error code. As the modsec.conf is only editable by the server provider, I add the following line to every root .htaccess: SecFilterEngine Off That turned off the mod_security filter in general.

Categories : PHP

Can multiple meteor application server instances work behind Hipache reverse proxy?
OK, I found the root cause of the problem by myself, here it is: https://github.com/dotcloud/hipache/issues/24 Something is broken with websocket support in hipache with node.js >= 0.10.0. I downgraded node.js in hipache and meteor containers to 0.8.25 and everything is working well now!

Categories : Node Js

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authorization Required"
You may not need the domain in front of the username. I had a very similar issue, and I fixed it when I removed the domain in front of the username. Since the proxy server is on a domain, I think it implies that your under the same domain.

Categories : Java

Nginx returns 404 on cached html files
Try this: location @rewrite { # Some modules enforce no slash (/) at the end of the URL # Else this rewrite block wouldn't be needed (GlobalRedirect) rewrite ^/(.*).html$ /index.php?s=$1 last; }

Categories : Nginx

Apache - Adding a URL redirect via Proxy Server
In the vhost config for 196.169.34.34, you can add: Redirect / http://196.169.34.21:3128/specific-url Replacing the specific-url part with the URL you want the browser to be redirected to. If you don't have vhost config access, you can add a rewrite rule to the htaccess file in your document root (assuming you have the proper overrides for an htaccess file and mod_rewrite): RewriteEngine On RewriteCond %{HTTP_HOST} ^196.169.34.34$ RewriteRule ^(.*)$ http://196.169.34.21:3128/specific-url/(.*)$ [L,R] You can make this redirect permanent by adding a 301: Redirect 301 / http://196.169.34.21:3128/specific-url or RewriteEngine On RewriteCond %{HTTP_HOST} ^196.169.34.34$ RewriteRule ^(.*)$ http://196.169.34.21:3128/specific-url/(.*)$ [L,R=301]

Categories : Apache

Trouble configuring apache server to proxy an SSL connection
You don't need the 8443 HTTPS connector in Tomcat. Apache HTTPD should terminate the SSL connection, and speak plaintext to Tomcat, via ProxyPass / http://localhost:8080/MYSITE/. You just need a plaintext HTTP connector with port=8080, and address=127.0.0.1 so no outsiders can get at it. Better still, dont' have any HTTP connectors in Tomcat, just an AJP connector, address=127.0.0.1 still, and use mod_proxy_ajp in Apache.

Categories : Ssl

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

Apache Jackrabbit throws 403 in WebDAV anonymous access
I found a solution. In web.xml file in section WebDAV the following part must be uncommented: <init-param> <param-name>csrf-protection</param-name> <param-value>disabled</param-value> </init-param> With disabled as param-value. As description says: Defines the behaviour of the referrer based CSRF protection 1) If omitted or left empty the (default) behaviour is to allow only requests with an empty referrer header or a referrer host equal to the server host 2) May also contain a comma separated list of additional allowed referrer hosts 3) If set to 'disabled' no referrer checking will be performed at all

Categories : Apache

Uploading image to FB staging server using jssdk returns error
According to the documentation, the file parameter needs to be actually file data (as in a enctype='multipart/form-data' HTTP POST). As an example they show posting via curl: curl -X POST https://graph.facebook.com/me/staging_resources -F "file=@images/prawn-curry-1.jpg" -F "access_token=$USER_ACCESS_TOKEN" It cannot take a URI that resolves to a file (you have to preform the fetch)

Categories : Facebook

opening webdav files in Chrome via the Office Authorization plug-in for NPAPI browsers fails for certain files
OK, thanks to Stuart's explanations in this issue, things started to make more sense. Basically I think the problem lies into the way the Microsoft plugin has been implemented when it comes to handling the strings that are passed from JavaScript. Stuart posted a question that shows the problem. The plugin code expects the strings to be null terminated when in fact that's not guaranteed. I did a test in my real app and I added the null character to url, i.e I passed url + '', and now the bloody thing works in Chrome. The question remains, is Microsoft going to fix their plugin?

Categories : Google Chrome

Uploading PDF files to Server in VB.net
Sub CopyDirectory(ByVal SourcePath As String, ByVal DestPath As String, Optional ByVal Overwrite As Boolean = True) Application.DoEvents() Dim SourceDir As DirectoryInfo = New DirectoryInfo(SourcePath) Dim DestDir As DirectoryInfo = New DirectoryInfo(DestPath) ' the source directory must exist, otherwise throw an exception If SourceDir.Exists Then ' if destination SubDir's parent SubDir does not exist throw an exception If Not DestDir.Parent.Exists Then Throw New DirectoryNotFoundException _ ("Destination directory does not exist: " + DestDir.Parent.FullName) End If If Not DestDir.Exists Then DestDir.Create() End If ' copy all the files of the current directory Dim ChildFi

Categories : Asp Net

ASP.NET MVC 4 - Uploading files to a server
This is a permissions issue on your server. On your local machine you are running under the context of your current user, which allows you to write to your disk. On the server, the IIS worker process needs permission to write to the uploads directory (it is not allowed by default for security). See this link for more information http://support.microsoft.com/kb/979124 To answer your other questions, uploading via an FTP stream is more complex and not necessary since the .NET framework includes everything you need to accept a file upload and save it. You might also be interested in trying out http://filepicker.io which offers a simple way to handle file management through an API.

Categories : C#

Uploading files on Server
This is a terrible way of uploading files, you are much better off using a form and the $_FILES superglobal. Take a look at the W3Schools PHP File Upload Tutorial; please read all of it. For further reading take a look at the PHP Manual pages on file upload. The file input type will create the upload box in the html form: <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file"><br> <input type="submit" name="submit" value="Submit"> </form> After error checking and validating that the file is what you are expecting (very important: allowing users to upload anything to your server is a huge security risk), you can move the uploaded file t

Categories : PHP

Uploading files to the server using HTML5
You need an upload script like this one : <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } ?> Check this link (http://www.w3schools.com/php/php_file_upload.asp)

Categories : PHP

Script not uploading files to my server
Your <form> tag should have enctype="multipart/form-data" attribute. See the example #1 here.

Categories : PHP

files().update(...).execute() method returns "400 Bad Request" only in the case of double-byte character user name
I have met this problem too, I think it maybe a bug. After my testing, I found when I create a new file to pass into update() method's second parameter, it works fine again, you can try it, good luck! File newFile = new File().setTitle(file.getTitle()).setMimeType(file.getMimeType()).setParents(file.getParents()); Files.Update updateOperation = mDriveService.files().update(file.getId(), newFile, fileContent);

Categories : Java

How to copy file from one server to another server in node js using webDAV protocol?
You can try with node module - poster for directly upload to server Stream local file var poster = require('poster'); var options = { uploadUrl: 'http://mysite.com/upload', method: 'POST', fileId: 'file', fields: { 'myfield': 'value', 'myfield2': 'value2' } }; poster.post('file.jpg', options, function(err, data) { if (!err) { console.log(data); } }); Stream remote file var poster = require('poster'); var options = { uploadUrl: 'http://mysite.com/upload', method: 'POST', fileId: 'file', fields: { 'myfield': 'value', 'myfield2': 'value2' } }; poster.post('https://www.google.com/logos/2012/addams11-hp.jpg', options, function(err, data) { if (!err) { console.log(data); } });

Categories : Node Js

Uploading Files in a specific directory on server
This has nothing to do with tomcat, it is handled by vaadin. Look the the book of vaadin for a example. https://vaadin.com/de/book/vaadin7/-/page/components.upload.html

Categories : Tomcat

Preview .doc/.docx/.pdf files before uploading to server
Back in the days you were able to do something like that: <object data="word.doc">You do not have Word installed on your machine</object> Not sure if this is still supported, but if so, you could use JS to inject that object onto the page to preview it.

Categories : Javascript



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