Nginx As Apache Proxy For Static Content -- Configuration
Nov 23, 2007
I am a non-tech person trying to configure Nginx to serve static content (apache will remain on port 80 for the dynamic stuff).
Nginx is already installed, what I need is a workable configuration file for nginx so that it serves all static stuff (images and a few folders with static html) and instructions in how to create it. The server is running DirectAdmin panel, Apache 2.24, PHP 5.23 and XCache 1.2.
View 12 Replies
ADVERTISEMENT
May 18, 2009
I'm looking for a way to get a little more mileage out of Apache + PHP environment without losing Apache capabilities. In shared hosting environments, losing features such as .htaccess and a real mod_rewrite are not even on the table. I'm also not willing to accept the performance hit and connection issues that are inherent with FastCGI, so that means mod_php.
In this particular situation, there are two busy sites, which are the problem.
These are a few ideas I've been thinking about.
1. mod_proxy + nginx: mod_proxy sends static content requests to nginx. This requires two sets of vhost files to be maintained.
2. mod_cache: Caching common static content such as page graphics .css, .js, etc.
3. squid
If you've been down 2 or more of these roads, I could benefit from your experience.
View 10 Replies
View Related
Sep 20, 2014
I am using a Windows 7 and the proxy server is working fine. However, I need to run a web content filtering on the server. This should be able to replace or change specific words or phrases from an incoming html and deliver it to the client. I have searched the internet for days for a working configuration but none of them worked. Here is the current configuration I added on the httpd.conf file:
<IfModule mod_ext_filter.c>
ExtFilterDefine add-tm mode=output intype=text/html/php cmd="Apache/bin/GnuWin32/bin 's/Company1/MyCompany1/g'"
SetOutputFilter add-tm
</IfModule>
<Location "/web/">
SetOutputFilter add-tm
OutputSed "s/Company1/MyCompany1/g"
</Location>
I have also uncommented these modules:
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
View 1 Replies
View Related
Aug 28, 2014
I am trying to setup dynamic content configuration in apache 2.2 httpd conf. Here is the configuration and couple test cases:
CONF:
<FilesMatch ".(js|css|gif|jpg|jpeg|png)$">
Header set Cache-Control "no-cache, no-store, max-age=0, must-revalidate"
</FilesMatch>
TEST 1:
Without <FilesMatch> directive, the headers are set to all requested content as it should. This includes content served from apache server and content from a separate application server.
TEST 2:
If I use the above configuration example, I can see that static content comes with correct headers only
View 1 Replies
View Related
Oct 7, 2009
I'm configuring an VPS that's going to serve all static stuff and absolutely no dynamic scripts at all.
What could be the bottle necks with all these static content websites? Can a 256MB VPS handle a static website receiving millions of page views a month?
View 1 Replies
View Related
Nov 21, 2007
I'm trying to serve as much gzipped content as possible on my web site. I will gzip dynamic pages on the fly using PHP, and I plan to gzip static content just one time, not to use much CPU, and serve css.gz, .js.gz files, etc... So, I uploaded a test.html file and a .css file that changes the color of the text to red. I gzipped the css file:
%gzip style.css
I also uploaded an .htaccess file with this content:
RewriteEngine on
RewriteBase /gzip/
RewriteCond %{HTTP_ACCEPT_ENCODING} gzip
RewriteRule ^(([^.]+.)+)css$ /$1css.gz
For now I'm not going to include any gunzipped style sheet, just to make sure my browser picks the gzipped style sheet. I also uploaded a phpinfo.php file to make sure I have mod_gzip. So, here's the list of files I have:
- .htaccess
- style.css.gz
- test.html
- phpinfo.php
But when I open the test.html file: [url] the style sheet isn't applied. If I upload a regular style.css file, it works fine. It seems the Rewrite rules aren't taken into account. Do you know how I could server the gzipped style sheet instead?
View 4 Replies
View Related
May 15, 2008
Ok, I'm a few lost about which dedicated server to choose.
First, I need 2 dedicated servers. These servers are only to download static content.
Downloadable files are small (50-400k).
I'll use lightweight server.
If there are too many user, I'll buy another server.
I search for excellent uptime, US server and fast download server.
I've visited some popular web hosting but if you know better, lets me know
1and1
Price (Root Server): $99
CPU: Single Core AMD Athlon 64 3500+ 2.2 GHz
RAM: 1 GB
HD: 2 x 160 GB
Bandwidth: 2,000 GB
Bandwidth Cap: 100 Mbps
GoDaddy
Price: $68
CPU: Celeron 2.0GHz
RAM: 1GB
HD: 1 x 120GB
Bandwidth: 500GB
Bandwidth Cap: 10-20 Mbps
Also, the price between 1and1 and GoDaddy is $31 but 1and1 give more on cpu, hd, bandwidth(4x), connection...
One of my question is 1and1 offers a average price for dedicated server or GoDaddy spends a part of money with Amanda, Candice and Danica?
Do you have some suggestion for dedicated server or web hosting?
View 8 Replies
View Related
Jul 14, 2014
We're running Plesk 11.5 on a CentOS 6.5 VPS and we would like to resolve the following problem:
We've configured a physical subdomain, lets say sub1.mydomain.com, and set up a couple of aliases for that domain in Plesk under:
Web Server Settings for sub1.mydomain.com > Additional Apache directives > "Additional directives for HTTP"
Code:
ServerAlias mysub1.mydomain.com
ServerAlias mysub2.mydomain.com
And
Web Server Settings for sub1.mydomain.com > Additional Apache directives > "Additional directives for HTTPS"
Code:
ServerAlias mysub1.mydomain.com
ServerAlias mysub2.mydomain.com
This config is working fine until we try to load resources from the alias over ssl, I believe something is missing in the Nginx config. I'm not getting any info using the logs.
For example:
http://sub1.mydomain.com/img/myimage.jpg --> works!
https://sub1.mydomain.com/img/myimage.jpg --> works!
http://mysub1.mydomain.com/img/myimage.jpg --> works!
http://mysub1.mydomain.com/img/myimage.jpg --> not loading
http://mysub2.mydomain.com/img/myimage.jpg --> works!
http://mysub1.mydomain.com/img/myimage.jpg --> not loading
Do we need to specify alternative directives for Nginx?
View 1 Replies
View Related
Jun 4, 2008
I've got a dedicated server running my portal. Now we plan to soon launch broadcasting, where we via a webcam + microphone will broadcast (streaming WMV media) to all our members. Our members will then be able to interact with the speakers via chatting.
Now we are currently undergoing loadtesting, with our current setup, which is:
1. dedicated server+ultrafast connection=>chatting
2. home PC with static IP and 1 MBit upload=>Video+Audio Streaming
So the member requests a page from the dedicated server, which has a chat window and a windows media player. The player will retrieve the video/audio content from the home PC. This is done by the client.
Now is pretty logical to see that there will be limitations in how many connections the home pc will be able to handle.
The question is: How do i make the dedicated server get the content from the home pc (so it only serves one connection) and then get all the clients to get their video content from the dedicated server ?
I've looked into the proxy modules for the apache server, however they (forward/reverse proxy) both passes the connection on to the remote machine and thereby not doing what I want to do.
View 0 Replies
View Related
Sep 14, 2014
Does the current Version of Plesk use a "real" nginx webserver or an Apache Webserver with nginx as a reverse proxy ?
View 1 Replies
View Related
Dec 2, 2014
Here is my setup
Centos6.6 x86_64 Minimal install + Plesk12 installation completed without problem.
However when I logged into Plesk Panel i get this message.
ERROR: PleskException
Up Level
Unable to configure control panel: nginxmng failed: [2014-12-02 07:32:44] ERR [util_exec] proc_close() failed
enabling nginx proxy failed:
255 Service /etc/init.d/httpd failed to start
Service /etc/init.d/httpd failed to start
Nginx proxy changes had been reverted.
Everything seems to work but i would like to have it enabled for performance reasons, when i check it
# /etc/init.d/nginx status
nginx is stopped
Then I try to start it manually
/etc/init.d/nginx start
Not starting nginx as it is disabled in config
then i try to force it
/usr/local/psa/admin/bin/nginxmng --enable
[2014-12-02 08:19:48] ERR [util_exec] proc_close() failed
enabling nginx proxy failed:
255 Service /etc/init.d/httpd failed to start
Service /etc/init.d/httpd failed to start
Nginx proxy changes had been reverted.
View 4 Replies
View Related
Apr 1, 2014
I've enabled the Reverse Proxy Server (nginx) in Plesk.
Code:
Tools & Settings > Services Management > Reverse Proxy Server (nginx)
With enabled nginx I'm unable to contact web pages via TLSv1.1 and TLSv1.2. When nginx is disabled and the pages are handled by Apache everything is fine. But only when nginx is completely deactivated. It's not enough to disable "Smart static files processing" at the "Web Server Settings for sub.domain.tld".
I tried to add "ssl_protocols TLSv1.1 TLSv1.2;" at "Additional nginx directives" at the Web Server Settings, without effect.
I think i have to modify /etc/nginx/plesk.conf.d/server.conf but this file is generated by Plesk.
System:
OS: Ubuntu 12.04.4 LTS
Panel version: 11.5.30 Update #38
OpenSSL 1.0.1 14 Mar 2012
Results of SSL Server Test:
Summary
Configuration (Protocols and Cipher Suites)
Protocol Details and Miscellaneous
Source: [URL]....
View 2 Replies
View Related
Jul 16, 2014
Trying to enable CORS (cross-origin resource sharing)? I've tried just about everything with the NGINX conf files and individual conf files, but nothing seems to be working...
View 1 Replies
View Related
May 29, 2015
For some reason my nginx doenst start and I get the following error:
Error: Unable to start service: Unable to manage service by nginxmng: [2015-05-30 01:03:20] ERR [util_exec] proc_close() failed
enabling nginx proxy failed: getsebool: SELinux is disabled
255 Service /etc/init.d/nginx failed to start
getsebool: SELinux is disabled
Nginx proxy changes had been reverted.
('--enable', 'nginx')
View 1 Replies
View Related
Dec 27, 2014
I would like to add spdy under all nginx configuration as below
listen 443 ssl spdy;
How to add them globally ?
View 4 Replies
View Related
Jun 5, 2014
I have following problem when I try to cange the configuration file for Nginx in Plesk.
Details:
- Using Wordpress
- vServer
- PHP is handled through Nginx
- Memcached is enabled
To use the caching plugin "Cachify" in combination with memcached, the nginx configuration file must be edited. Following config should be used:
Code:
## GZIP
gzip_static on;
## CHARSET
charset utf-8;
## INDEX LOCATION
location / {
error_page 405 = @nocache;
[Code] ....
When I try to save the new config, following error appears:
Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/systemmydomain/conf/vhost_nginx.conf:8 nginx: configuration file /etc/nginx/nginx.conf test failed
How can I use the necessary configuration? I used google before, but some people said, that the server templated needs to be edited?
View 1 Replies
View Related
May 5, 2009
i successfully installed Squid Proxy on my other Dedicated server however that dedicated server had 50 ip address, i am wondering if i can use those ip address for my Squid Proxy?
View 5 Replies
View Related
Nov 14, 2013
I transferred my WordPress site to static HTML website, but some other website have a link to my old WordPress site URL....
I want to redirect all traffic from that URL to new URL which is URL...., but my redirect in .htaccess file doesn't work (Redirect 301 /?page_id=1234 URL... because of the query string."mod_rewrite" to create the right code in .htaccess file.
View 1 Replies
View Related
Jun 10, 2013
I'm using the isapi rewrite module for iis 6 which uses the exact same syntax as mod_rewrite in apache. I'm not very well versed in apache and need getting this to work asap. Basically I have a directory in our website: URL....
I need to forward this to an IP address, for example to this address:100.12.33.45/folder.While keeping the original URL (www.xyz.edu/folder). I'm unsure of the apache syntax for this.
View 3 Replies
View Related
Jun 23, 2009
Here is the comparison between Apache and Nginx. Request processing overhead and real-world application performance measurements included.
[url]
View 7 Replies
View Related
Aug 14, 2008
I am doing my web like this:
1) nginx listening at port 80
2) apache listening at port 78
3) nginx throws all shtml pages to apache
they are working perfectly, except one small thing:
I don't want any public visitor may visit port 78 directly, for now, both:
[url]
[url]
are working for visitors.
Anybody knows how to block/hide port 78 to the public access?
my nginx config snippet:
Code:
location = /index.shtml {
proxy_pass [url]
}
my apache2 config snippet:
Code:
Listen 78
If I make apache as follows:
Code:
Listen 127.0.0.1:78
I will get 502 bad gateway when I visit:
[url]
View 1 Replies
View Related
Apr 13, 2015
I am wondering if there is an easy way to convert apache to nginx on my Plesk 12 server. Ideally, I would like to save all my hosts without having to re set them all up. I have been searching online, but haven't found a simple way to do so.
View 1 Replies
View Related
Apr 20, 2009
According to the latest trend and technological advances, which server software should people go with from the very beginning. Which do you recommend as on today?
btw anybody has experience with all 3 (apache/nginx/litespeed) webservers?
I have -
On a common shared environment, I started off with Apache - was fine until some load started generating and it became crapache.
Then litespeed - Totally awesome, could seriously feel the difference, but its cost is something not everybody can afford.
Then nginx - Very nice, felt like litespeed only, the only difference was it got quite complex in configuring it at a later stage BUT its free'ness made me love it badly.
View 4 Replies
View Related
Feb 25, 2015
I have a VPS running Parallels Plesk 12.0.18 Update#36 and CentOS 6.6. I'll like to move (if it's possible uninstall complete) Apache and let Nginx to manage all the request coming from outside.
View 4 Replies
View Related
Dec 17, 2014
We'd like to use this tool from Google on our Plesk server: [URL]
is it useful getting these tools going on server, and are they worth it?
View 1 Replies
View Related
Feb 5, 2015
Whatever i try to modify configuration there is no way i can get file delivered by apache or NGINX to be deflate/gzip compressed.
OS: Debian 7.7
Plesk version: 12.0.18 Update #33
I've tried to add these lines to Nginx (Vhost directives) but it change nothing :
# Gzip Settings
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 4;
gzip_http_version 1.1;
gzip_min_length 1100;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/x-javascr$ application/xml application/xhtml+xml application/xml+rss;
gzip_vary on;
gzip_static on;
gzip_proxied any;
gzip_disable "MSIE [1-6].";
I also tried to disable Nginx and configure deflate in apache with following lines (Vhost directives then in a file in apache2/conf.d) but it is the same ...
<IfModule mod_deflate.c>
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s*,?s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
[code]....
View 5 Replies
View Related
Nov 24, 2012
How to convert apache rewrite rule to nginx:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^naujienos+ news.php/$1 [L]
RewriteRule ^naujienos/p(.*)$ /news.php?pg=$1 [nc]
RewriteRule ^naujienos/?$ /news.php [nc]
RewriteRule ^naujienos?$ /news.php [nc]
View 5 Replies
View Related
Jul 23, 2014
I want to pass the X-SENDFILE header to apache through nginx.
Is this possible or do i have to disable the reverse proxy?
View 1 Replies
View Related