php - convert nginx to apache

888

I am moving a php app from a server that runs ngnix to apache2. I need to convert the nginx configuration to a apache virtual host file. I have found a lot resources on converting from apache to nginx but not a lot on going from nginx to apache.

Here are the parts I need to convert:

rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;

# this allows people to use images and css in their maintenance.html file
  if ($request_filename ~* \.(css|jpg|gif|png)$) {
break;
  }

  # this rewrites all the requests to the maintenance.html
  # page if it exists in the doc root. 
  if (-f $document_root/maintenance.html) {
rewrite  ^(.*)$  /maintenance.html last;
break;
  }

  location ~ .php$ {
fastcgi_pass   127.0.0.1:1026;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  /data/static/domain$fastcgi_script_name;
include        fastcgi_params;
  }

  location ~ .js$ {
fastcgi_pass   127.0.0.1:1026;
fastcgi_param  SCRIPT_FILENAME  /data/static/domain$fastcgi_script_name;
include        fastcgi_params;
  }

}

I have already enable the fcgid mod on apache, but if there are any others I also need to enable, please let me know. The area that really confuses me is the last two parts where it has location.

Thank you!

People are also looking for solutions to the problem: Delete mySQL table from php link not working (Blank page appears)

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.