地址如http://vpsxxx.ovh.net/g/search?q=ok或http://vpsxxx.ovh.net/so/questions/34738694/how-to-move-items-on-the-screen-for-a-game-using-javascript当从浏览器url栏中尝试它们时, http://vpsxxx.ovh.net/so/questions/34738694/how-to-move-items-on-the-screen-for-a-game-using-javascript是很好代理的 但不是从JS,甚至在添加CORS头后,例如: http : //jsfiddle.net/crl/svmw93a8/1/,http : //jsfiddle.net/crl/svmw93a8/2/ 甚至一个请求的根/像: ajax('http://vpsxxx.ovh.net').then(function(r){ console.log(r) }); 不工作 这里是conf文件: server { listen 80; server_name vpsxxx.ovh.net; # some ovh server location /g/ { proxy_pass http://www.google.com/; } location /so/ { proxy_pass http://stackoverflow.com/; } location / { # I tried putting it before other locations too proxy_pass http://www.google.com/; # added here also, for […]
我试图用nginx代理一个由外部主办的javascript和图片 我在https上运行我的网站,他们只通过http提供的文件,我已经有与他们有关的联系,但不能给时间线,当他们走了解决这一点。 所以没有我想在我的nginxconfigurationproxy_pass这些文件我有以下位置块 location /blogcounter/image { #rewrite ^/blogcounter(.*) /$1 break; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://widget.external-domain.tld/$uri$is_args?$args; } location /blogcounter.js { #rewrite ^/blogcounter(.*) /$1 break; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://widget.external-domain.tld/$uri$is_args?$args; } 我想在我的网页上的小工具是。 <a title="external-domain.tld" href="http://external-domain.tld/" id="hr-random_id" target="_parent"> <img src="https://my-domain.tld/blogcounter/image?image=red_s&blog_id=random_id" alt="alt-text" border="0"> </a> <script type="text/javascript"> var […]
在proxypassconfiguration文件我已经写了这一行 ProxyPass /directory/ ajp://localhost:8009/directory/ 它完美的作品 在htaccess文件 RewriteRule ^seconddirectory/(.*)$ http://domain.com.localhost/directory/$1 [P] P旗意味着L. 这也可以 如果我只使用[L],它也可以。 无论如何,将与ProxyPass相匹配。 但我希望代理通过AJPredirect只有当引用包含/ action如果不是,则不能使用ProxyPass 我试图用RewriteCond做一个条件 RewriteCond %{HTTP_REFERER}% !/action RewriteRule .? – [S=2] RewriteRule ^seconddirectory/(.*)$ https://domain.com.localhost/directory/$1 [L] RewriteRule .? – [S=1] RewriteRule ^seconddirectory/(.*)$ https://domain.com.localhost/404 [L] 如果(引用者不包含/动作),在这种情况下,跳过2行,并被redirect到404页面 如果URL是 HTTPS://domain.com.localhost/seconddirectory/anything 我被redirect到https://domain.com.localhost/404 这是对的 如果引用包含/操作 我不会被redirect到https://domain.com.localhost/directory/ $ 1 这是来自https://domain.com.localhost/controller.php/module/atoken/action (referer)的引用者。 任何build议?
我正在迁移我的服务器使用mod_proxy_fcgi和php-fpm而不是mod_php。 Apache能够将.php请求转发到fcgi代理,PHP正确执行。 我有这个工作: ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1 不幸的是,即使文件不存在,Apache也会将所有.php请求转发给代理。 这导致一些问题。 我的ErrorDocument规则不会被调用,而DirectoryIndex index.php index.html不会退回到index.html。 我能用mod_rewrite修复这些问题: RewriteEngine On RewriteCond %{REQUEST_FILENAME} ^/((.*\.php)(/.*)?)$ RewriteCond /var/www/html/%2 -f RewriteRule . fcgi://127.0.0.1:9000/var/www/html/%1 [P] 但是,Apache文档不build议使用RewriteRule :“这是因为这个标志触发了使用默认的worker,它不处理连接池。 理想情况下,我想要在FileMatch块中使用ProxyPass(当前不支持),或者定义一个新的处理程序,通过fcgi代理并使用它来处理.php请求,类似于mod_php。 任何build议模拟标准的mod_php设置,但实际上通过fcgi代理?
我需要传递一些请求来代理(运行GlassFish),删除一段url。 例如: https://xxx.net/jazz/MobileApi?id=2&make_id=4 应该通过代理作为: http://XXXX:8080/MobileApi?id=2&make_id=4 我有以下的Nginxconfiguration: upstream vito_api { server 178.63.XX:8080; } server { listen 80; listen 443 ssl; …. location ~ /jazz/(?<section>.*) { proxy_pass http://vito_api/$section/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } 但是,不幸的是,请求传递没有参数。 所以,在GlassFish访问日志中,我只能看到: "148.251.XX" "NULL-AUTH-USER" "05/Jan/2015:15:18:40 +0100" "GET /MobileApi/ HTTP/1.0" 200 21 我做错了什么? 如何传递url参数? 谢谢。
我有一个域(example.com)和一个子域(sub.example.com)都托pipe在同一台服务器上。 我想代理一个请求,所以在http://sub.example.com/api/上请求的任何文件都会在http://example.com/api/ (和参数一起)上被请求。这里是我的nginx代码sub.example.com: location /api { rewrite /api/(.*) /api/$1 break; proxy_pass http://example.com/api; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_buffering off; } 这对我不起作用。 什么工作是: location ~* ^/api/(.*)$ { rewrite ^/api/(.*)$ http://example.com/api/$1 last; } 编辑:我忘了说,我的服务器定义包含一些关于Yii框架和parsing的PHP文件的规则。 这是完整的服务器声明: server { listen 80; server_name sub.example.com; access_log /var/log/nginx/sub.example.com.access_log main; error_log /var/log/nginx/sub.example.com.error_log info; root /var/www/localhost/htdocs/sub.example.com; index index.php […]
在Apache 2.4中,你可以使用以下方法将HTTP连接代理到本地Unix套接字: [1] ProxyPass unix:/path/to/app.sock|http://example.com/app/name 您可以使用以下方法将代理WebSocket连接反向代理到本地TCP套接字: [2] ProxyPass ws://127.0.0.1:12345/app/name 但是,你怎么能反向代理一个WebSocket连接到Unix套接字? [☹]
我尝试使用ProxyPass和ProxyPassReverse通过Apache将请求代理到另一个服务器实例,该另一个服务器实例绑定到Vhost所在的另一个TCP端口上的本地主机(VHost绑定到:80,目标绑定到5000时)。 但是,我在访问位置时反复接收HTTP 503。 根据ProxyPass文档 … <VirtualHost *:80> ServerName apacheserver.domain.local DocumentRoot /var/www/redmine/public ErrorLog logs/redmine_error <Directory /var/www/redmine/public> Allow from all Options -MultiViews Order allow,deny AllowOverride all </Directory> </VirtualHost> PassengerTempDir /tmp/passenger <Location /rhodecode> ProxyPass http://127.0.0.1:5000/rhodecode ProxyPassReverse http://127.0.0.1:5000/rhodecode SetEnvIf X-Url-Scheme https HTTPS=1 </Location> 我已经testing了将备用服务器绑定到接口IP地址,并发生同样的问题。 服务器服务请求是python粘贴的一个实例:httpserver,它已经被configuration为使用/ rhodecode后缀(正如我在其他关于ProxyPass的post中看到的那样)。 项目本身的文档 Rhodecode报告使用上述内容。 如果我将其他服务器作为另一个端口上的服务器,则此问题将持续存在。 ProxyPass允许代理到不同的TCP端口吗? [更新] 如果有人遇到同样的问题,我不会删除这个。 我已经设置了ErrorLog,并且在ErrorLog中报告了以下错误: [Wed Nov 09 11:36:35 2011] [error] […]
**更新与解决方法在这个答案的底部** 我有一个要求我的web应用程序代理到2个外部报告服务器。 所以我将为每个外部报告服务器提供一个菜单项。 但是,浏览器的URL也看起来像我的服务器,所以我不能只是redirect。 这些服务器都具有相同的上下文根/ ibm 对于这两个服务器,浏览器URL应该看起来像http://example.com/ibm ,而apache代理正确的。 应该如何做这样的设置? Apache如何知道它必须代理哪个? 如果我不得不做一些改变,那么URL将会变成: http://example.com/rep1/ibm and http://example.com/rep2/ibm 我设法使用我的weblogic-proxy servlet和操作URL等来达到预期的效果,但是如果可以以某种方式完成,Apache将是一个更高效的解决scheme。 我很欣赏任何input。 此外,对外部报告服务器的初始请求是从我的web应用程序启动,而不是从浏览器启动。 **更新** 我们现在必须代理约10个其他的networking服务器,其中一些有这个问题。 但是每当目标web服务器被部署在根目录中时,我们也必须重写主体等等。对于这些代理集成中的一些来说,这是一个试验和错误。 解决方法:我们已经切换到这些代理服务器的子域,实际上子域URL仍然指向我们自己的Apache,但是使用这些子域名,我们可以更容易地在我们的Apacheconfiguration中设置一个虚拟主机和代理服务器,我们不必重写任何响应机构等。
我在configurationnginx时遇到了问题,我已经在网上search了解决scheme,而且我还有一些零碎的东西,但是我仍然无法提出正确的configuration。 我已经注册了一个域,比如说 – www.example.com。 我已经在注册商网站上configuration了所有的东西,ping www.example.com和www。*。example.com成功。 我的机器上运行Apache Tomcat侦听端口8080.我想设置dynamicproxy_pass。 所以如果我的应用程序MyApp运行在tomcat中,并且可以通过localhost:8080 / MyApp访问,我希望能够通过www.MyApp.example.com访问它,所以基本上这个子域名就是tomcat中的应用程序名称。 这是我的nginxconfiguration: server { server_name ~^(www\.)?(?<sub_domain>.+)\.example\.com$; listen 80; location / { proxy_pass http://localhost:8080/$sub_domain/; } } 当我到www.myapp.example.com时,我被redirect到http://localhost:8080/myapp – 我的意思是在我的浏览器中直接inputhttp://localhost:8080/myapp 。 但是,如果我将nginx安装程序中的正则expression式更改为: server { server_name www.myapp.example.com myapp.example.com listen 80; location / { proxy_pass http://localhost:8080/myapp/; } } 那么一切都像一个魅力。 我知道它必须做一些解决scheme,我已经尝试将parsing器放在nginx中,但它没有任何改变。 我在这里错过了什么? //编辑: 这是我的configuration。 我仍然被redirect到www.myapp.example.com/myapp/login而不是www.myapp.example.com/login。 我改变了正则expression式,仍然是一样的。 http { upstream backend […]